I'm on my second front loader...haven't had the problem with this one but I do clean it once a month using a bleach cycle like the other moms recommended. Depending on the age of your front loader (my first one was nearly ten years old), and if cleaning it doesn't help, I would strongly suggest having it checked by a professional. My first one was not draining completely, and some water had built up in the motor, which was a great breeding ground for mold. My heating/cooling guy (aka my best friend's husband) came over and cleaned the motor out, temporarily fixed the leak since we were only going to have the washer for a month more, and the smell disappeared.
Another suggestion is to add vinegar or ammonia to every wash cycle, using the bleach compartment (only when bleach is not used). It not only freshens clothes, it tends to make them whiter and brighter.
Good luck!