Step 1: Rule. The correct phrase is "invite someone to a meal/event."
Step 2: Checking options. (A) in — wrong. (B) of — wrong. (C) by — incorrect. (D) to — correct.
Step 3: Conclusion. The right answer is (D) to.