A good way to clean a washing machine is vinegar and baking soda.
If your washing machine has a detergent dispenser place the baking soda into the detergent dispenser and some baking soda into the washing machine drum.
If your washing machine doesn't have a detergent dispenser just mix the vinegar and baking soda together in the washing machine drum and then run it through a wash cycle using the hot water selection.
This will help clean the washing machine and get rid of any smells in the washing machine.