"mir" (the dative case of "ich") corresponds to "to me" in English. Mich, on the other hand, is the accusative and is equivalent to simply "me". Compare:
He wrote a letter to me - Er hat mir einen Brief geschrieben (dative - to me)
He hit me - Er hat mich geschlagen (accusative - me)
This is the reason why one of the most common mistakes by Germans, when speaking English, is "Write me", when they mean "Write TO ME" (Deutsch: Schreibe mir).
More formally, the dative is used to express what is indirectly affected by a verb:
Er hat mir die Schuhe geklaut - He stole my shoes from me
The shoes are in the accusative case since they are directly affected by the action ("The shoes were stolen"). "He" is in the nominative since "he" carried out the theft. The last noun left is "me" and takes the dative, since you are indirectly affected. I hope that clears that up somewhat. After a while the dative will just "feel right" when it comes to thinking in German :)