I thought "mich" should be after the subject, becasue "mich" is the accusative in this sentence.
You are wrong, both variants are equally possible, since German is quite tolerant in respect to word order; there is just a tendency to put more emphasized words to the front of the sentence, see this question. So
Die Eltern meiner Freundin haben mich neulich zum Essen eingeladen.
would emphasize Eltern.
(Definitely colloquial is die Eltern von meiner Freundin which can be shortened to the more universal die Eltern meiner Freundin).