This has been done a variety of ways across the editions, the main differences being how experience and treasure are handled. NPCs are typically controlled by the GM, but like all things, do whatever is fun.
The Rules Cyclopedia has a really good system for hiring retainers, and I have used a version of it for years.