The first thing to do is to CHECK IN AND AROUND THE RUBBER DOOR BOOT (called a bellow) for small articles of clothing (like socks and underwear) that may have gotten lodged in behind the rubber. Pull the rubber back where it meets the wash tub and look behind it. It is common for small items to get stuck here, become forgotten and start to mildew. You should check this area after each wash and clean it periodically to get rid of the formation of soap scum, mold, and mildew. HINT: When you get ready to wash a load of towels, take a dirty towel and clean the door boot thoroughly (including the areas behind the rubber). Immediately place the towel in the wash and run it on a sanitary cycle. This way you eliminate the need for cleaning rags.
PERIODICALLY RUN THE WASHER ON A CLEANING CYCLE. Place the washer on the hottest setting you have (usually a Sanitary cycle) with nothing but bleach in the wash tub. Some newer models actually have a "Clean Cycle" available now just for this purpose. This helps keep the wash tub, drain lines and pump sanitized.
CHECK AND CLEAN THE DRAIN PUMP FILTER. Accumulations of debris in the drain pump filter can also cause odors. HINT: If you own a shop vac, pull the drain hose from the standpipe at the wall and pull a vacuum on the line. This will drain any residual water left in the tub, pump and drain lines BEFORE you remove the drain pump cover. This will prevent a messy clean up later.
LEAVE THE DOOR OPEN IF POSSIBLE. When not in use, leave the door open to allow the tub to air out and to keep mold and mildew from forming on the door bellow. I know this may not be desirable in some households with small children. If too much mildew forms on the rubber and it cannot be removed, replacement of the bellow may be required.