The main problem is gonna be harassment. A flying force can fly high above any group and continually fire arrows and drop stones and such, well out of range of any return fire. They can then retreat to a resource cache and restock and continue, harassing any organized force. No castle will be safe, and no organized group is going to be able to coordinate effectively.
The obvious counter to this is living underground. Heavy earth barriers can stop casual assault, and with enough time you can tunnel to any fixed locations of the enemy. Then you can have heavy troops with thick armor slay any dragons while fast skirmishers capture and kill the remaining dragons. Imagine very heavily armored knights armed with crossbows or longbows and axes emerging from the ground into hatcheries, and horse riders with short bows to chase down the fleeing children.
There's also gonna be a lot of need for skilled archers and sling users. They can pick off any archer who gets too close and protect any key infrastructure from enemies dropping explosives or firebombs on them.
They'd also need a crop that is resistant to burning. They could perhaps grow them all in separate stone basins, so a fire wouldn't spread, or use something like rice which has been flooded with water so it doesn't burn well.
https://en.wikipedia.org/wiki/Tunnel_warfare#Roman
This has long been a type of warfare, used against well organzied and deadly forces. I Imagine that in medieval times once heavier armor was invented, thick plate strong enough to resist arrows from above, humanity would start to surge up. Captured slaves and skilled rebels in thick armor would crush the aerial enemies wherever they gathered, retreating to underground hideaways whenever threatened.
The invention of guns would complicate things for humanity. Bombs and guns allow an aerial force a great deal of mobility and deadliness. They have little accuracy, but massed fire can still slay an attacking force, and the accuracy issue would be much harder on humans than flying dragons. The heavily fortified castles of the humans could be smashed with dropped gunpowder bombs from on high. I imagine humans would keep using bows, since they are easier to use accurately. Skilled bowmen who could deflect dropped projectiles would be in high demand, as would the few rebel dragons who might help scout and protect humanity.
There would be a strong push to develop flying vehicles, and I imagine hot air balloons would be invented a lot earlier in this timeline. While less agile, a flood of hot air balloons would make it a lot harder for the dragons to maintain aerial superiority. This is probably around the time peace would happen, when the dragons started to lose some of their aerial advantage and had some terrible retreats. Imagine thousands of primitive hot air balloons with skilled bowmen and crossbow users picking off fleeing dragons from a highly fortified castle of theirs, while from below knights with lances and short blades of powerful steel cut those resting as they burst from the floors.
By modern times, there would be a stalemate. The Dragons would have vastly superior scouting and infantry capabilities, but the technology and heavy fortifications of humanity would make an attack difficult. Trenches and dug out fortifications would litter the land, for any human to retreat to, and deadly weapons of chemical and explosive nature would be ready to poison the tunnels. I imagine the dragons would have advanced a lot in chemical warfare, to counter the human tunnel advantage.
Open massed warfare would be almost unheard of, with humans relying on fortification to protect them and quick raids against targets who had landed, and the dragons attempting to use their superior height and speed and mobility to slash supply lines.