Which one is grammatically correct: It was me who called you., or It was I who called you.? Similarly, which one is correct among these two: He and me were going to the forest, or He and I were going to the forest?
It was me who called you and It was I who called you are both grammatical in Standard English, with the second being more formal than the first.
He and I were going to the forest is also grammatical in Standard English. He and me were going to the forest is not, but it may be found in other dialects.
The simple guide in this situation is "me never does anything". The more complicated version is that I is a subject pronoun and me is an object pronoun.
I (subject) bit the dog
The dog bit me (object)
On that basis, in your first sentence, me can't call you, but I can. In the second, me can't be going to the woods, but I can.
In real life though, as Barrie correctly says, nobody would bat an an eyelid if you said It was me who called you. This is probably because the 'it' looks like a subject of 'was', making the 'me' appear to be an object. Strictly speaking, the 'was' is not the active verb. That honour goes to 'called'.