There are normally two steps involved to do this:
1. create a WAV file
2. encode the WAV file into an MP3 file
Many PC-based morse code programs will be able to produce WAV files.
MP3 encoders are readily available. "lame" (http://lame.sourceforge.net/
) and "blade" (http://bladeenc.mp3.no/
) are two examples. But I am not sure if they are available for Microsoft Windows or Mac (I run Linux). If needed you will certainly find Windows or Mac-based MP3 encoders by doing a Google search.
There is one big problem: MP3 is a lossy compression scheme that is physiologically optimized (optimized for the average "human ear Bode plot", and for music). The developers of MP3 did not have Morse code in mind. The result depends on the MP3 encoder and player you are using, but because of the hard-keying and no-noise nature of the Morse code you may experience a lot of distortions (it sounds horrible and is pretty much useless).
The solution is to make the Morse-WAV file more real-world like. Means you may have to add some noise, and/or you may want to lowpass-filter the WAV file before encoding it into MP3. I used Matlab to add some noise, which solved the problem. Unfortunately I don't know about any freely available program that does this. Let me know if you find one. Of course you could also write your own program.
Another possibility would be to record code from the air, for example from the W1AW code practice runs, and then encode that into MP3.
BTW, ARRL has code-practice MP3 files on their webpage, see http://www.arrl.org/w1aw/morse.html
But these files also have the hard-keying / non-noise problem, means they will playback distorted on many players.