Well, first off, there's 2 schools of thought that approach groupping for raids. The first carefully organizes groups for maximum effectiveness (this is what I do), and the second is more relaxed and trusts people to form workable groups on their own. Some guilds can pull off the second well, but I don't care for it.
Now, there's quite a few different styles of raids each needing their own groups, and then you have all the individual quirks of your members. It gets very complicated, and no one template will be the best for every situation. It's probably easier for me to give a short description of -why- to group each class where, and then some example groups for a few different raids. Keep in mind this is intended for characters that have all their spells/skills, so some things will not be accurate for more mid level raiding, but it's still a good baseline.
Bard: far and away the most complicated to group, because they are useful for so many different things. First off, they are (arguments aside) the best class suited to pulling right now, so in clears they might not even be -with- the raid, and you might have them groupped solely for quick communication with other pullers. Secondly, they are the best maintank enhancers, with incredible +armor class and damage shield songs, not to mention Psalm of Veeshan's huge resist for anti-main tank spells from raid mobs. So some raids you'll want to make sure the main tank has a bard. But they are also the largest group damage increasers for either melee or casters, and in a lot of raids you'll have groups of all wizards and a bard, or rogues and a bard. Then, because of a low resist mess with no mana cost, ae slow, and high sun they can be even better than enchanters for CC in specific situations, and might need more focused heal coverage. They are easily the most complicated class to group well on raids, and this is further compounded because a lot depends on how well the bard plays.
Shadowknights: You group them for 3 things really- group hp/mana tap, group ATK buff, or to tank. Generally, if I have say, a bard and 2 SK's on the raids, I'll group the bard with the wizards for muse then the SKs with melees, so you get the most mileage out of DPS improvements. You need to strike a balance really. On some raids where mana is a huge problem, sometimes you could even throw SKs in with the caster group and just let bite do it's job and tap them a bit of mana each minute. Not super effective, but it's always an option. Lastly, you need to decide whether you really want that knight offtanking. If they are, they need adequate protection. The problem is the more healing you devote to keeping a SK up, the less effective their atk tap really is, since dps classes won't be the ones backing them. A group with an SK, cleric, druid, sham, rog, rog is a lot less effective DPS wise than SK, cleric, rog, rog, rog, rog... though the SK certainly won't stand up to a sudden aggro from a serious raid mob with a single cleric backing them against top notch raid mobs. But you need to decide when you build the group really what you want him doing.
Paladin: Really, you group paladins for 2 different reasons- as a group healer, or as an offtank. Alert paladins are extremely powerful secondary healers, and I think it's very foolish to overlook their effectiveness there. In pure AE fights, they are significantly stronger than druids or shamans as a healer backup and do DPS as well- so you put them with melee heavy groups they'll stand near, and the groups will face much less risk of attrition, which makes the raid far more durable. On some raids, it would be a heck of a lot easier if all melee were paladins. On others, they are kind of shuffled off to an emergency role. Paladins are very strong offtanks (arguably the strongest) due to good snap aggro and some very fast heals they can throw on themselves to help mitigate mob dps. Also, I tend to use them as rampage tanks on bosses, since they can gain it easily by positioning the mob with DA at the start, then mostly spam heals on themselves through the fight to deal with page.
Necro: has some of the strongest group powers in the game, but highly situational. If a raid encounter allows mindwrack (group mana tap that can only be cast on targets with mana) necros should always be groupped to take advantage of that. There's not a single encounter where mindwrack was possible that's ever been a large problem for me for long. It's simply too big a swing. Their group heal isn't really enough to heal in and of itself, but it can help a bit to counteract light damage and take some heat off the group. On ae fights, I usually try to fit them in with the wizards to give them a slight nudge up against the damage. Outside of AE fights, not very significant. Lastly, their damage is extreme, and if you have bards to spare, they definitely should have muse.
Wizards: Damage. They are tricky because they must live, but they neither should be taking damage outside of AE's (and even then, not if you can help it) or have much chance to survive direct aggro even with most healers covering them. Give them enough healers to deal with AEs, a bard if you can, and little else. On raids where I know they won't take damage, it's not uncommon for me to have 5 wizard, 1 bard groups. Likewise, 4 wizard, 1 druid, 1 bard is frequently used.
Mages: Wizards, but less so. There's a few (VERY few) encounters where you actively use CoH, and you need to group them specifically for that. Usually, they fill in spots in wizard groups where you run out of wizards. They have useful abilities, but keep in mind most of those don't require a group to function at all (pet, summons), and mages simply will not outdamage a wizard.
Rogues: Damage. More chance of direct aggro and even of surviving it, so they usually have clerics at least. But again, give them just enough support to survive, then maximize their dps.
Rangers/Monk: These guys are tougher, because they are a DPS class, but just less than rogues, and in my experience you usually run out of damage enhancers (SKs, bards) well before you run out of damage dealers. So they tend to get stuck in groups without enhancement, and I usually use them to round out tanker melee groups (ones with offtanks with a lot of heal coverage, like war/cler/shm/dru/enc/rang) If you have bards for them, awesome, if you don't, then just fill in slots in tank groups where they'll see the most protection.
Beastlords/enchanters: Typically, they are groupped much the same. The thing is, beastlord dps just doens't see significant improvement from bard or SK, so you wouldn't really group them there. What they do see, is a lot of aggro and some semi offtank situations from early slows. Similar with enchanters. They'll never be a damage dealer (unless you are so lucky you are on a raid where you can use charms), but it's crucial they are protected. So both should either be in groups with top notch healing, or basically on the sidelines in reserve groups where they contribute their dps without needing much support. It depends on the raid.
Berserker: I can't really say because we have no berserker well equipped enough yet to contribute meaningfully on a raid for me. It's hard to say how well a guy with his epic is doing when everyone else is using Time or post-time weaponry. Not to mention our tanks literally have three times the health, let alone the mitigation.
Cleric/dru/shm: How much healing do you need, how much group curing do you need, who needs cured, how important are group heals? These are the questions you ask when groupping these guys. Sometimes you barely spread out one per group, sometimes you have them clustered around melee, sometimes you have groups with no healing at all but a long cleric CH chain groupped together with druids and shamans sprinkled in the groups to focus on curing and healing them. All depends on the raid.
Warrior: They are tanking, or they aren't. A warrior should be able to guess from how he is groupped.
Okay, so that's a lot of information to sort through, but then how do you group people specifically?
Well, let me give a pile of people and you can see how to do groups based on a few different raids:
2 warriors, 2 paladins, 7 clerics, 3 rogues, 2 bards, 2 enchanters, 3 shamans, 5 wizards, 3 ranger, 2 SK, 1 berserker, 1 beastlord, 1 necro, 1 mage, 3 monks, 3 druid
For clearing:
1. War, cleric, sham, dru, enc, monk (possible puller)
2. War, cleric, sham, enc, bst, dru
3. Bard, cleric, rog, rog, rog, SK
4. cleric, pal, SK, rang, rang, monk
5. cleric, pal, shm, rang, monk, dru
6. cleric, bard, wiz, wiz, wiz, nec
7. cleric, wiz, wiz, ber, mag
Now, groupped for an ae fight with maintanking needed:
1. War, war, cleric, sham, pal, bard
2. cleric, cleric, cleric, cleric, bard, druid
3. cleric, rog, rog, rog, SK, pal
4. cleric, pal, rang, rang, rang, monk
5. dru, sham, monk, monk, ber, beast
6. wiz, wiz, wiz, nec, dru, wiz
7. sham, enc, enc, mage, wiz.
Hopefully that gives you a better idea of how to do groups for raids.