I usually remove the cotton cover on the mattresses and wash in the machine (cold water to stop shrinkage), then give the foam a quick hose off and dry in the sun. My advice would also be to invest in a couple of good plastic backed mattress protectors, you can get a similar thing for pillows too.
I always wash my pillows in the machine to freshen them up, they come up nice and fluffy after a stint in the dryer.