Eliminate the Mildew
Mildew is a blue-green, slimy substance that smells bad and can be potentially harmful to respiratory health. Often trapped within the seal that frames your washer door, it will need to be removed if you are get rid of the unpleasant odor.
Mix a powdered detergent -- laundry or dishwasher soap -- into warm water and scrub the seal of the door with a soft brush dipped into the soapy water. Use a sponge dipped into the soapy water to wipe down the inside of the washer.
Clean the Washer
Turn on the washer and allow it to run through a complete cycle with hot water and 2 cups of chlorine bleach to sanitize it. Open up the door once the cycle has finished and see how it smells.
If it still doesn't smell clean, repeat this process. Open up the door once it has finished and the smell is gone to allow it to air out.
Cleaning Other Problem Areas
If the musty smell is persistent, perhaps it's hiding somewhere else rather than inside the door. Remove the back panel and disconnect the hoses that carry the hot and cold water to the washing machine.
If you have any questions on how to remove the back panel, refer to the owner's manual. Make sure that the washer is unplugged first.
Use a wet/dry vac to clean any debris out of the hoses before reconnecting them and putting the panel back on. Run the washer through a cycle with hot water to rinse out the hoses.
Use only the recommended amount of laundry detergent per load, per the manufacturers' instructions. Extra soap will cause a buildup and can lead to mildew accumulation as the soap mixes with bacteria.
In between loads, open up the door and allow fresh air to get in. This will help to dry out excess moisture that would otherwise sit in the washer and become stagnant.