These are all correct and common uses but mean something different. The present perfect tense is used to express something that has continued in the past up to the present time. It may or may not continue from now into the future. The past simple tense expresses something that was done in the past and not continued. So for instance, the first pair you sited above. "What did you do to me?" is asking about something done ONCE in the past. But the sentence, "What have you done to me?" expresses something that may have happened once or several times in the past and continues up until now.