Quoted from Wikipedia, on their articles on crossbows and longbows. Also, yes, I realized this is tl;dr, and I realize that many people don't consider Wikipedia a reputable source, but its a better source than anecdotal evidence or hearsay.
"The crossbow prod is very short compared to ordinary bows, resulting in a short draw length. This makes crossbows less efficient at releasing energy, and to compensate they must have very heavy draw weights"
Crossbows require a harder draw for equal force. This is why there are no mighty crossbows. A heavy crossbow is hitting with more force than a longbow, though. This is presumably because crossbow technology continued to improve.
"In later years the bolt of a crossbow had enough kinetic energy to penetrate any chainmail and most plate armor hit squarely: some reached a draw force of nearly 1600 N (350 lbf), compared to the 300-900 N (60-180 lbf) draw force for a longbow. Moreover, crossbows could be kept cocked and ready to shoot for some time with little effort, allowing crossbowmen to aim better."
"There are no surviving longbows prior to the 15th century but more than 130 from the Renaissance period exist (see Surviving bows). Descriptions range in length from 1.2 to 2.11 m (4 ft 1 to 6 ft 11 in). They were made from imported yew in preference, although ash and other woods were also used. Estimates for the draw of these bows varies considerably. Estimates made on examples from the Mary Rose, typically had draw forces of 72–82 kgf (706–804 N, 160–180 lbf ). A modern longbow's draw is typically 60 lbf (27 kgf) or less. Today, there are few modern longbowmen capable of using 180 lbf bows accurately."
900 N was pretty much the top end for Welsh longbows. That means that a heavy crossbow in D&D, which is one of those that indeed, does have an insanely powerful pull mechanism should be doing more damage. Also, more quoting from Wikipedia:
"To penetrate chain mail armour, many war arrows had 'chisel' (or 'bodkin') heads and were quite massive. Bodkin arrows have tips like elongated pyramids, which result in a very sharp and very narrow point. With their bodkin points these massive war arrows probably weighed around 65 to 100 grams (1000 to 1500 grains, grain being a unit of measure often used for arrows and bullets). This is 2 or 3 times the weight of the wooden or aluminum arrows that are used today and 4 to 5 times the weight of modern carbon fiber arrows or pre 20th century 'flight arrows', used in distance shooting contests."
"The longbow had a long range and high accuracy, but not both at the same time. Modern champion archers maintain that you cannot 'guarantee' a hit on an individual target at more than 80 yards with any bow whatsoever. Most of the longer range shooting mentioned in stories was not marksmanship, but rather thousands of archers throwing volleys of arrows at an entire army. As they were aiming at a large mass at a particular distance, they could extend their range substantially."
So longbowmen had to not only worry about what kind of ammo they were using, as to penetrate armor, they had to pretty much halve or third their range and accuracy....but they also had problems shooting at longer range.
"Although an expertly handled longbow had greater range, equal accuracy and faster shooting rate than an average crossbow, the value of the crossbow came in its simplicity: it could be used effectively after a week of training, while a comparable single-shot skill with a longbow could take years of practice. The invention of pushlever and ratchet drawing mechanisms enabled the use of crossbows on horseback."
There's the real reason that crossbows were used. Cheaper soldiers, and you could utilize crossbow cavalry. This was -TERRIBLY- deadly. Crossbowmen were the premiere soldiers during the Crusades, and mounted crossbow.
As for guns, taken from the Arquebus article:
"As low-velocity firearms, they were used against enemies that were often partially or fully protected by steel-plate armour. Plate armour was the high standard in European combat from about 1400 until the middle of the 17th century. This was essentially the era of the arquebus. Good suits of plate would usually stop an arquebus ball at long range. It was a common practice to "proof" (test) armour by firing a pistol or arquebus at a new breastplate. The small dent would be circled by engraving, to call attention to it."
"The arquebus came into prominence during the Battle of Pavia in 1525 in which 3000 arquebusiers defeated 8000 French knights, thus ending the knight's domination in Europe. The defeat of these knights by the heavy fire of Spanish arquebusiers inspired other people to adopt the weapon. Arquebusiers also played an important role in Cristóvão da Gama's battles against the superior numbers of his Muslim opponents in Ethiopia during the 1540s, and later in the Moroccan victory over the Songhai Empire at the Battle of Tondibi in 1590."
Yes, gunpowder arms were -FAR- less accurate(which gave them a lower effective range), and slower-firing than their crossbow and longbow counterparts. But they could -SHRED- plate armors like nothing else. This made for a terribly deadly weapon during sieges, and on the defensive, and even mounted soldiers could run up, get their shots off, and then engage in regular mounted combat, decimating whatever troops are left after the initial volley.
***********
Also, the crossbow is a totally great mook weapon and great for loads of mooks to use. They're deadlier in the hands of noobs than longbows, when you're wanting to do as much damage with the few hits that land. Additionally, you only really need a few feats to be good with a crossbow. Much like in real life, if you're a professional archer who does nothing else and has the feats: Take the longbow. If its your secondary weapon, or you're not a primary fighter, or you want the extra damage and don't have the strength to take advantage of a heavy pull bow: Take the crossbow