I used to work in a house that had a dirty, musty smell. It was so bad that the tenant of the house would leave their belongings where we would take them when they came to move out. The landlord eventually brought in a professional exterminator to kill off the infestation and eliminate the musty smell.
While there was no solution that I could devise for getting rid of the smell completely, I was able to take a few steps that made it easier to clean up the stench. I began by taking everything outside and drying them off thoroughly. Not only did this make it easier to get the smell out of the carpet, but it also made it easier to eliminate the odor from the air as well. After it was dry, I put a plastic bag over the item and left it for a couple of hours. Then I took the bag outside and set it on the grass. This provided more humidity, which allowed the smell to evaporate faster.
There are other things that you can do, however, to help with getting rid of the smell. You can try using baking soda to absorb the odor. In some cases, simply spraying baking soda onto the carpet will eliminate the smell.
Get the smell out of your vaccuum cleaner instantly with Farmhand Tom's Odor Eliminating Spray.