You're going to have to get rid of the fleas in the carpet at the same time you get rid of them on the dog.
I suggest you take your dog to be bathed and groomed. While the two of you are out, you may have to resort to flea bombing the place.
If you don't want to use a flea bomb, you can try sprinkling flea powder onto the carpets and allowing it to sit for a while before you vacuum it up. Again, you must also address the fleas on the dog; if you do not, you will keep having reinfestations.
You might look into some of the topical flea treatments which are available. Applied correctly (based on your dog's size and weight) they are generally very effective.
Consistent flea prevention treatment will usually keep this from happening. In the meantime, vacuum regularly!