If your washing machine is getting smelly, it is probably due to a build up of limescale and undesolved washing powder which builds up around the tub, and as this is always slightly damp it tends to give off a smell not unlike a drain.
To resolve this problem just put a mug full of soda crystals (washing soda) in the empty drum and do an empty hot wash, 60 deg or above. Doing this will desolve the residue in the tub and pump it away down the drain (where the smell belongs). If your washing machine has a filter remove and clean after doing the soda wash and you will find all the gung in the filter. If you don't have a filter don't worry all the gung will be pumped away. Repeat this every 6 months to keep your machine smelling fresh.
The same treatment will also work to get rid of mould on the door gasket (little black spots) of your machine, but you may need to repeat the treatment two or three times.