Eating your main meal in the evening doesn't make any sense metabolically - after you've eaten you're going to have very little time to burn off what you've just eaten, and sometimes not even enough time to digest it. So it's a recipe for poor digestion, weight gain and waking up feeling sluggish. And yet it's still pretty common for people to eat most of their calories for the day after 6pm.
I find that if I eat according to appetite I'm hungry for dinner around 6pm to 8pm and then have no desire for food after dinner until breakfast the next day. So when I'm in France and have to eat late it wreaks havoc with my routine. At 6pm I end up having a substantial snack that means I'm not hungry for the five courses I get served for dinner at 9pm!!!
Obviously if you're at home or able to choose when you eat out, try and eat at least 3 hours before you go to bed. If you really don't have a choice i.e. you're eating out with friends or a guest at someone's house, then have a carb based snack around 6pm and then keep to protein and non-starchy vegetables for dinner. If you do have a super late banquet and then feel like going straight to bed, try and keep upright for 40 minutes to give your digestion a chance to get going.