In Starcraft 2, I want to maintain unit formations. Other than having one unit type follow another, and then only directing the lead unit type to move, I maintain a pseudo formation, that is my longer ranged units in the back, etc... Is this the only way?
I prefer and recommend setting a group per unit type, but setting some of those groups to follow other groups as appropriate.
In your question, you describe a group for the melee units and simply having the ranged ones follow. This might be an easy way to keep formation, but when it's time to fight you will spend critical moments trying to get that ranged group to attack.
If you give each unit type its own group, you can gain instant control over any group when it comes time to fight. In the meantime, you can easily set ranged and flyers to follow the melee group so you keep a rough formation.
You could also use the tab method instead of multiple groups. In my experience, however, this fails when you have more than 2 unit types. In the heat of battle, having to tab or shift+tab to whatever group you want is wasted keystrokes and can cost you a few units in the time it takes to swap.
I'd extend Shaun's answer a bit, and recommend grouping together units that go well together, and also having all units into control groups. Putting units into a follow command is unreliable and you'll end up leaving units behind.
For example, for Terran, all marines and marauders can very well be put into one command group, since they have the same movement speed and you can stim all of them at once. Tanks and even thors could be another control group. Both of them are support units and pretty slow, so they can be left behind a bit.
Zerg can put zerglings and banelings in one command group, roaches in another and mutalisks into a third.
Protoss should probably put melee units (zealots) in one control group, and ranged units (sentries and stalkers) into another.
If you need to micromanage a unit type individually (for example put marauders in front of banelings), it's easy to control-click (or double click) on one unit type, and all such units on the screen get selected.
But, to be honest, until you're out of silver/gold (or even platinum), you should do good with just putting all units in one control group if you're not playing zerg. But it doesn't hurt to get into the habit, if you have the hand speed, and control them individually. Zerg needs to tend to their units very much, so there it's good to get used to 2-3 control groups immediately.