Well, I know they figure out the number of calories using a calorimeter. Since a calorie (note, lowercase c) is equal to raising one gram of water 1 degree Celsius, one can measure the energy released when the food is burned or otherwise has the energy taken out of it. Note that since a calorie is very small, all of today’s food is represented in Calories (uppercase C) which is called the kilogram calorie or kcal, equivalent to 1,000 small calories.
A neat fact, since Canada implemented Nutrition Labels much later than the US, our recommended vitamin/mineral percentages are different, since they use up-to-date science.
If you’re going to start making and selling food, there’s a lot of other research you’ll need to do and rules you must follow. Your kitchen has to be a certain level of cleanliness, I guarantee you don’t meet it now because the rules are so tight (such as the three-sink dish washing method, which is pretty impossible in a normal kitchen with one sink). You will also need a business license and to keep proper records. I’m sure you know most of this, but other readers might not :)
Here’s some info I found for you about nutrition requirements for small businesses in America. Apparently if you run a small enough business (less than 10 employees) with sales not exceeding 10,000 units, you can apply for an exemption from the nutrition labeling requirement. However, if you make any type of health claim about your product (“sugar-free”, “low carb”, “trans fat free”), either on the product label or through advertising, you can NOT be exempt no matter how small your business is. And you need to renew each year. And you still have to list your ingredients and comply with all other labeling requirements. But still, it’s handy to know.