Is this a front-loading washer? If so, there's an article at http://www.consumersearch.com/www/house_and_home/washing-... that says:
Although all experts say front loading washing machines are more efficient and do a better job cleaning clothing than top loaders, front loaders haven't been the most reliable. Partly because they represent relatively new technology for the consumer market, they have a learning curve. Because of their design, they require more daily attention. For example, we've ready many reports that front loaders can develop a mildew smell caused by the water that can remain standing in the gasket and other washer parts after a cycle. Users say that owners can wipe away water after cycles. There's actually now a product on the market to address this problem. Affresh washer cleaner tablets (*est. $7 for three tablets), developed by Whirlpool, are supposed to combat mildew and odors in high-efficiency washers. However, owners posting to online forums say that dishwasher detergent also works well. Others suggest leaving the washer door cracked open after loads, so any remaining water can evaporate.
We had this happen in our front loading washer. When we moved and looked for another washer, the salesperson said it was because the washer sealed so tightly. We used Affresh and it worked well.