Bi-carb of soda? I use that if anyone wets the bed and it draws the smell right out. Presumably it'd do the same thing on any other smells? Just sprinkle on a thick layer and rub it into the surface. Leave it for a while then just brush it up and throw away.
I second the bicarb route. If that still doesn't solve it and the mattress is white you could dilute some Milton fluid and put in a spray bottle and give the worst bits a spritz. This combo worked with dried in milk spills for me.
If you'd posted a while ago I would have suggested sticking it out in the garden for the day. Second the bicarb etc and would suggest that you buy a decent matress protector or two (doesn't have to be waterproof) and wash them frequently