As to the original question - assume it's because the machine started smelling, or you were experiencing black "greasy" bits on your clothes - or both?
This is caused by build-up of soap, from either fabric conditioner and/or use of washing liquids, in too large quantities, without regular cleaning.
To stop the build-up in the first place, put the machine on a 90 wash once every month or two, with nothing in it.
To get rid of it, many of the domestic appliance repairers use a little bleach and a hot wash.
You need to be very careful with the amount of bleach you use (absolute max a capful, but in some cases that might be too much), not necessarily because of the damage to the machine, but because it softens the water and makes things much more soapy. This is a much bigger problem here in places like the North West where we have very soft water in the first place. Too much, and the machine oozes soap suds from the soap drawer and overflow!
If the build-up in the machine is very bad, you might need a few goes at hot washes to get rid of all the soap.
EUR ING Graham Kenyon CEng MIET TechIOSH
Principal and Proprietor,
G Kenyon Technology