First of all, Crossbows are for those that don't specialize in range combat. The reload time and inability to add your strength to damage makes the best crossbows only viable to combatants that don't wish to invest much into them and would only use them once per encounter. I'd suggest using a Composite Longbow or Composite Greatbow (Complete Warrior). If using a crossbow is essential to your character concept, ignore this advice completely, of course.
Most feats should be pretty obvious: Rapid Shot, Manyshot, Precise Shot, Able Sniper, Far Shot, and so forth. Outside the obvious, I'd suggest taking Martial Study from Tome of Battle and take the Cloak of Deception maneuver so you can shortly turn invisible as to hide when you fail your sniping attempt. Though to avoid failing your sniping, always try to hide as far away from your enemy as possible as to add the maximum penalty to their spot modifier.
Equipment-wise, I'd recommend a bow made of
Deep Crystal, it's a great material enchantment that requires power points, but it's pretty much one of the only ways a ranged combatant can keep up with melee juggernauts and spellcasters.
Boots of Speed are also a must. Strongarm Bracers (Magic Item Compendium) will increase the size of the bow you can wield. And when you can afford it, a the Splitting enchantment (Champions of Ruin) will complete any archer build. Also, don't forget to stock up on enchanted arrows.
In terms of classes, Ranger, Fighter, and Psychic Warrior are your best choices, but I'd recommend a 2 level dip in Ardent, mostly for the power points, but also to take the Conflict Mantle for a free Weapon Focus feat, Light and Darkness Mantle for darkvision, and the Mental Power Mantle for extra power points. As for Prestige Classes, many people will recommend Cragtop Archer for it's extended range, but boosting one's spot check to see farther than 195ft away (the first range increment of a Composite Greatbow with the Far Shot feat) is pretty outrageous to me and makes this Prestige Class all but worthless. My recommendation is Kensai, the ability to spend experience points instead of gold to enchant your bow means you can spend more gold on items that boost your dexterity and strength, not to mention more enchanted arrows.