When I first started (June 2002), I got a few dwarf hermit crabs. They have since moved up to some small Turbo snail shells - about the size of a nickel. They have killed off a few snails but don't seem to bother anything lately. If you do get hermits, I would keep it to a few. Expect a few snail casualties though. You can throw a few extra snail shells in to minimize this.
If you have a sandbed, I would highly recommend Nassarius and Cerith Snails, as well as a Fighting Conch or two (these grow fast and require 2 sq ft of open sandbed each). These will help aerate the sandbed and eat detritus. For other snails that will graze on algae, I would recommend Turbo and Tiger Trochus Snails.
I believe in getting a diverse cleanup crew to help address a variety of things in the tank. In addition to above, I also have Strombus snails (decent algae eaters and breed like crazy), a Serpent Star, a couple of Fire Shrimp, and a couple of Emerald Crabs.
As to a formula, do not follow the 1 per gallon of anything. This is just to get you to buy more. It really depends on the size of tank, amount of rock, how often you feed, and what else is in the tank. Getting too many critters with not enough food available will mean they will slowly starve to death.