I found this...long worded, but sounds easy enough
As with any home appliance, your washing machine requires regular maintenance and upkeep to ensure optimal performance. Washing machines can develop a foul odor after long-term use, and this odor will affect the cleanliness of your laundry. (Please note that the following steps are intended for owners of top-loading machines, not front-loaders.)
Step 1 - With your machine empty, run it full of hot water to the largest load setting. When the tub is full and begins to agitate, add 3 to 4 cups of distilled white vinegar to the water. Then add ½ cup of baking soda. Allow the machine to agitate for a few moments, then turn off the machine. Let the water sit for thirty minutes to one hour.
Step 2 - After allowing the vinegar/baking soda mixture to penetrate the grime in the washing machine tub, restart the machine, allowing it to complete the wash cycle. At the end of the wash cycle, as the tub begins to drain, advance the washing machine to the spin cycle. On many washing machines, this will cause the washing machine to spin as it drains, which can help to further loosen any residue. If yours doesn't do this, simply allow it to drain. Turn off the machine.
Step 3 - Wipe the inside of the washing machine tub with a wet cloth. If desired, use a cloth soaked in a solution of half hot water and half white vinegar. Be sure to wipe all inside surfaces, including the bottom and blades of the agitator and the top of the tub just under the lid. (It is sometimes helpful to use a wire toilet brush around the top rim and in hard-to-reach places.) If the washing machine has a fabric softener and/or a bleach dispenser, remove these and clean thoroughly before replacing.