Today's washing machines require more care than the ones you grew up with. On a front load washer for example it's common for mold to begin to grow on the rubber door seal. This will produce a very foul odor. This can be handled by leaving the washer door open when not in use so the moisture can evaporate. Cleaning the rubber seal by hand periodically will also help. Another good idea is to run a monthly cleaning cycle with a product like "Affresh". This will help eliminate any unseen bacteria.
When adding detergent, fabric softener, or bleach make sure you use the proper amount and clean up any spills that may occur. Using too much can cause poor washing performance and foul odors.