how calculate gears from scratch

A technical problem I face is how do I figure out how to calculate gears from scratch in a assembly system. Meaning i have a space X between two centers and i need to gears to lock in with some ration how do I figure out Dedendum Addendum working depth and all the other stuff. I can figure out how to draw the involute curve but how can I figure out the rest. I know the number of teeth and gear rations are based on diameter of gear but whats the relation of the measurements to the center distances of two gears. Anybody have any idea how should I go about this?