The Battle of Qohor (around 100 B.L. (1)) is also known as the tale of the Three Thousand of Qohor. The Dothraki horselord Khal Temmo led his khalasar east and sacked and burned every city in their path. His host numbered at least 50.000, half of them warriors.
Aware of his advance, the Qohorik strengthened their walls, doubled their garrison, and hired two companies, the Bright Banners and the Second Sons. They also sent a man to Astapor to buy 3.000 Unsullied.
But it was a long march back to Qohor, and when the Unsullied finally reached the city at night, it had already been attacked. The Qohorik heavy cavalry had been annihilated, and the sellsword companies had fled in the face of hopeless odds.
Because of the darkness, the Dothraki had retired to their camps to drink and feast. But they were going to storm and sack the city as soon as dawn broke.
The Qohorik were prepared however, and 3.000 Unsullied were arrayed in battle formation before the city gates, as the Dothraki approached the city next dawn.
Although the small force of Unsullied could easily have been outflanked, the Dothraki launched a direct frontal assault, in an attempt to simply ride down the heavy infantry. The Dothraki's contempt for infantry was reflected in their simple, but flawed tactics.
Despite being faced with 20.000 Dothraki light-cavalry, the Unsullied didn't lose heart and stood firm. The Dothraki cavalry charged their front 18 times, and their horse-archers showered them thrice with heavy missile volleys, but the Unsullied still didn't break.
The Dothraki finally halted their attacks after the Khal, his bloodriders and sons had been killed. Their losses were staggering: 12.000 dead. Only 600 Unsullied remained, but the victory was theirs nonetheless.
Four days later, the new khal led his remaining khalasar past the city gates in a stately procession. Each man cut off his braid (2) and threw it down before the Unsullied.
Since then, the city guard of Qohor had been made up solely of Unsullied, with a braid of human hair hanging from their spears.
How could it be that 20.000 mounted Dothraki were unable to defeat 3.000 Unsullied? And why didn't the Dothraki try to or manage to outflank their enemy? Ser Jorah explains that it was the Dothraki's contempt for foot that made them resort to frontal attacks only, but I find it hard to believe that was the only reason. After all, 18 failed attempts should have convinced the Dothraki commander to try another, less direct approach.
Apart from the fact that heavy infantry can resist a heavy cavalry charge (even if the Dothraki used stirrups), one explanation could be that the Unsullied's position was so strong that flank-attacks were either impossible or difficult to execute. A hill would, for example, give them the advantage of fighting downhill, and it would also provide some protection on their flanks. A natural obstacle would of course make flank attacks impractical or impossible, and an uneven ground would hamper their advance. The Unsullied knew what they were up to, so it's no wonder that they'd seek a strong, defensive position.
At that time the Dothraki probably had little experience fighting disciplined, heavy infantry, because the attack on Qohor was part of their first western raiding campaigns. Their light cavalry was also highly unsuitable for frontal attacks, because of their light armor (if any, because the Dothraki considers armor fit only for cowards). It is also worth noting that the Dothraki only attacked thrice using missiles, which strongly suggests that they ran out of arrows, and the only offensive option left was shock action, a mode of combat in which the Unsullied were superior. Of course, they also had the option to simply retreat or surrender, which in my opinion would have been the wisest thing to do because they faced a strong defensive force and they lacked the option of attacking the enemy at the flanks or in the rear.
Their leader, Khal Temmo, obviously didn't know how to handle this new and unexpected situation, but refused to give up despite tremendous losses. Ultimately, it cost him his life. His lack of tactical skills, his overconfidence and his narrow-mindedness stand in contrast to the traditionally skilled commanders of the Mongol steppe-people (of whom Ghengis Khan is the best known), who were in many ways the historical, real-life counterparts to the Dothraki.
(1) In order to put the events depicted in ASoIaF into a chronological perspective, I've decided to use the year of Aegon I's landing in Dragonstone as a chronological reference. B.L. stands for "before Aegon I's landing", and A.L. stands for "after Aegon I's landing". Most of the events in the three first novels occur between 296-299 A.L.
(2) The Dothraki custom is to cut their braids when they lose a battle.