One thing that helps me with late night snacking is having relatively harmless snacks on hand - like cherries, frozen fruits, etc. Obviously it would be better if I just didn't eat after 8pm or so, but its better to snack on cherries than cheese and crackers.
Check out this site, which has a nice energy expenditure calculator, as well as one for weight loss (look under "Popular" to the right):
First you figure out the energy expenditure, then you enter that into the weight loss calculator and figure out how much you want to lose per week and, voila, there's your calorie goal. They recommend that going for more than 1,000 calorie less than your energy expenditure; I'm actually counting 1,300-1,500 less, but am not counting fresh fruits and raw veggies so it ends up being about the same as I tend to have 3-5 servings of fruit per day.