We’ve actually covered How to Calculate the Energy Value of Food
In the early days, we used a combination of ingredient supplier specs and verified nutritional databases to work out calories. From a legal perspective, these are based on Atwater, but Atwater does take in to account fibre. I still do it this way, however, as we’re grown we send product off for regular testing, including new products, and I verify the figures I’ve used on the pack through testing.
For fibre, we use two (of the four available) different methods of analysis depending on the product (due to the different fibre sources). From this (and available carbs, protein and fat) our lab uses an appropriate energy calculation. I check this with my calculation.