Each group rolls d6, highest goes first. Common sense applies.
Some examples of common sense applied.
-Spell Casting. If it takes you one melee round to move 120 feet, and you want to try to disrupt the spell of the evil wizard who is 60 feet out of reach, then you must spend the first 5 segments of the round moving. That means if the casting time of the wizard's spell is less than 5 segments, he automatically gets his spell off first. If it's more than 5 segments, you automatically get to attack first. If it's exactly 5 segments, the initiative roll determines order of action.
-Ranged Attacks: If it takes you one melee round to move 120 feet, and you are fighting the evil archer whose rate of fire is 2 per round (and he wasn't prepared to fire) then he fires on segments 5 and 10. If you are less than 60 feet away, you can close to striking distance before he gets a single arrow off. If you are more than 60 but less than 120 feet, he gets a shot at you before your initiative die even matters.
-Weapon reach: Longer weapon automatically gains first strike during "charge" attacks. When closing to attack, speed is of equal importance and for convenience the two factors--reach and speed--are assumed to negate one another and you just defer to the unmodified initiative die. However, if you really need to be a stickler for such things, each character involved gets a modifier equal to their weapon length minus weapon speed.
-Groupings: It's "group" initiative. Not "side" initiative. If the bad guys consist of evil cleric with a bodyguard and acolyte and a dozen skeletons, the DM can make separate initiative rolls, one roll for all the skeletons, for example, and a second for evil cleric and his two henchmen. Likewise, large PC parties might get one initiative die for everyone who is fighting, and a second initiative roll for anyone who is doing anything else. Or very small PC parties (like 3 people) might just each get their own initiative roll. After all, their "side" is just three groups of one each group. Group initiative is versatile like that.