I was admitted to medical school in Munich several years ago, but ended up going to a U.S. school instead (and going 150K into debt! Big mistake!) At that time, foreigners paid the same registration fee as Germans- which was around $300 or so per semester. You can't beat the price!
Back then, international students applied directly to the medical school they were interested in attending, but the rules are different if you're considered German. In that case, you have to go through the match with the ZVS (which is like a national clearinghouse for assigning medical school spots).
Here's some info about the ZVS that applies only to those considered native Germans:
http://www.zvs.de/Service/Download/M11.pdf If you don't qualify for consideration with the German applicant pool, then you have to apply directly with the medical school.
Here's the international student information specific for Heidelberg:
http://www.zuv.uni-heidelberg.de/AAA/ Good luck- hope this helps!