To get rid of fleas on your dog:
Ask your vet for "Capstar" to kill adult fleas, and also use "advantage", "advantix" or "frontline" which only kill immature fleas. That should rid your dog of all fleas. The problem is that you might now have some in your house, so your dog can easily be re-infected. Wash all bedding (preferrably in hot water) and use an anti-flea spray for the home (or anti-flea powder that you vacuum up) to get rid of any fleas that might be on your sofas, rugs, etc. that you can't easily wash. If your dog still has one or two fleas (which I highly doubt if you did all of the above), use a "flea comb" to get them out and drown them in a container of vinegar.
Hope that helps! (It got rid of ALL fleas on my dog! With NO re-infestation for over a month. Remember, you have to reapply "advanitx" or whatever to keep new fleas from hatching on your dog.)
As for getting fleas out of the carpet, there are anti-flea powders that you sprinkle on the carpet and then vacuum up. Fleas in carpets are best controlled with carpet powders containing an ortho boric acid material that is labelled for killing fleas. "Pest products" sells a godd, child-safe one. Also "Results Flea and Tick Killer" or, suposedly, if you sprinkle table salt on your carpet and leave it for an hour, and then vacuum it up, it kills fleas. But I'm not sure if that one really works. It may just be an old wives' tale. :)