Don't wait until the day of the party to start this. Start from the moment you write the invitations. I have never intentionally violated this rule, although one time I didn't realize there was a new girl in my son's class. I make sure everyone gets invited. If you don't want that big a crowd, or if there are one or two children in class that your birthday child simply cannot abide, mail the invitations or deliver them in person outside of the school setting.
Manners are especially important when it comes to opening presents.
Take it back to the store and get me something else. The birthday child will thank everyone while opening the gifts. I try to keep a list of each present and its giver, then a day or so after the party I ask the birthday child to dictate a thank-you. As soon as my kids can write their names, they sign their dictated thank-you notes themselves. Be sure there's plenty to do.