As @Bernd has pointed out, 2.5 really is the midpoint of the 0 to 4 year age group, etc. However, using midpoints at either end of the population distribution introduces bias. For instance, the midpoint of the 80 - 90 year group is approximately 83, because most people in this group are nearer 80 than 90. If this nicety matters (and it perhaps it does, if you are agonizing over a half-year difference), read on.
Demographers make their estimates using various methods of monotonic interpolation. A classic method is Sprague's Formula. This is well described in their literature; for an overview see Hubert Vaughan, Symmetry in Central Polynomial Interpolation, JIA 80, 1954. This method as published requires equally-spaced age groups but it can be adapted to variable spacings. @Rob Hyndman was the co-author of a nice paper on monotonic splines (Smith, Hyndman, & Wood, Spline Interpolation for Demographic Variables: The Monotonicity Problem, J. Pop. Res. 21 #1, 2004). The paper mentions R code for the "Hyman filter." It is still available on Rob's Web site.
Once you have an interpolated age distribution you can compute moments (and any other properties) according to the standard definitions. For instance, the mean is estimated by numerically integrating the age with respect to the distribution.