Vets will tell you that chocolate is toxic for dogs and cats. This page at about.com says:
The toxic dose of Theobromine (and caffeine) for pets is 100-200mg/kg. (1 kilogram = 2.2 pounds). However, various reports by the ASPCA (American Society for the Prevention of Cruelty to Animals) have noted problems at doses much lower than this - i.e. 20mg/kg.
Translated to a "typical" scenario, and using the 20mg/kg as a measure of "problems can be seen at this level of ingestion", a 22.7 kg (50 pound) dog would have to consume about 255 grams (9 ounces) of milk chocolate to consume the 20mg/kg amount of Theobromine. Some dogs won't see problems at this rate. Some may.
So it would seem that a mid-sized dog could probably eat a typical chocolate bar without impact. But a typical mid-sized cat (say 4.5 kg or so) is asking for trouble at 28g (1 oz) of chocolate.
Of course, if you prefer really strong dark chocolates, it will take less weight of candy bar to deliver the same dose as estimated for milk chocolate.
As the about.com piece points out, those are conservative numbers. The actual lethal dose is likely much higher.
One other note: Caffeine is also a problem for dog and cat metabolism. That article claims a similar range for toxic doses as for theobromine. I would be careful about letting the cat finish your tall mocha latte...
Here are some supporting links from the about.com article:
Moving to a more technical source, Merck has a Veterinary Manual with a reference page on chocolate. The information there generally confirms the About.com article (which should not be surprise because it is cited as a source) and is similar to other summaries for pet owners that Google turns up. It is, however, written with a practicing Vet as the intended audience.
The toxic effect is explained by Merck as follows:
Theobromine and caffeine are readily absorbed from the GI tract and are widely distributed throughout the body. They are metabolized in the liver and undergo enterohepatic recycling. Methylxanthines are excreted in the urine as both metabolites and unchanged parent compounds. The half-lives of theobromine and caffeine in dogs are 17.5 hr and 4.5 hr, respectively.
That means that as long as the lethal dose is not exceeded, and the dog's liver function (and kidney function as well I assume) is not otherwise compromised, the theobromine and caffeine will eventually be excreted. With a half-life of 17.5 hr, it would require about 40 hr to reduce a near lethal dose of 100mg/kg to below the mentioned clinical effect threshold of 20mg/kg. (We want to reduce the dose by a factor of 5 from 100mg/kg to 20mg/kg. So we calculate 17.5 * log2 5 = 17.5 * 2.32 = 40.6 and round that to 40 or so to one significant figure for a reasonable estimate. Two days is also a reasonable estimate.)