See here: http://stackoverflow.com/questions/4809874/how-to-access-the-sms-storage-on-android
The gist is that SMS/MMS are residing in databases on the phone and the answer to the question contains the link to this tutorial.
The location of the database might vary from phone to phone, but you can look it up with this command via adb (you need to be root to find it because it's in the protected storage area):
find / -name "*mmssms*"
On my device (Samsung Galaxy S) these databases turned up:
The first one being the native db and the second one is by the sms app I'm using.