Lately, there's been an influx of products on the store shelves that advertise that they can clean the leftover soap scum out of your washing machine and also remove the (sometimes) musty/sour smell.  Most are priced around $10 a bottle and according to various reviews I've read - work with scattered results.

Here's a more economical choice that I stumbled across while scouring the internet - and one that I can vouch for:  Use powdered dishwasher detergent!

The various posts that I encountered that suggested this method all reasoned that the ingredients of dishwasher detergent were similar to what these companies were putting in  their "washing machine cleaners".  In addition, they reasoned that dishwashers saw the same level of dirt as a washing machine (if not more...) and they always end up remaining (semi) spotless inside.  Plus - most of us have dishwasher detergent around and it costs much less than the other products.

How did it work?  I actually had good results.  While my washing machine didn't necessarily smell, I figured that it probably had a lot of built-up gunk in it seeing as it's almost 15 years old.  I made a point to be around the sink when  the initial wash water drained out and I was amazed at the amount of gunk that made its way out of the machine.

I should also point out that my washing machine is a top-loader, but I've read that you can also use this process on front-loaders, too.

The process:

Measure about 1/2 to a full cup of powdered dishwasher detergent and pour it into the tub of your washing machine.  Next, fill it full with hot water - as hot as you can get it.  Let the cycle run for about 5 minutes, and then stop the cycle - letting the water sit in the tub for about 10 minutes.  After that, restart the paused cycle and let it finish.

Good luck - and feel free to share your experiences.