Check out the
MyFitnessPal web site (free); it allows you to enter recipes and it will calculate the nutritional values of the meals. If you use the phone app (available for iOS, Android, Blackberry, and Windows) you can use the bar code scanner to easily and quickly add ingredients to meals/recipes. Once you see how each ingredient contributes to the carbs/protein/fat levels in a recipe you can tweak the recipe to get the 40/40/20 ratio you want.
Cheers,
Keith