While I don't have a program for you, I'd give you some historical context to help you design it yourself; army units aren't standardized in the medieval period.

"Units" are often the levy of a particular town. Five men here, ten there, maybe a hundred if they're from a city. They each report to the man above them in the fuedal system. So you're better off having random rolls for the number of men below a particular guy than setting a hard ratio.

This is one of the significant advantages the English had in the hundred year war. The French army was each knight to their lord, each count to their duke, etc all the way up the chain. This meant there were units of wildly varying size and conflicts at each level of command. The English put ALL of their archers under the command of a single man, allowing them to act more efficiently.