They both evolved independently of one another and only through adaptive evolution did they develop the close interdependency that they now enjoy.
The horribly oversimplified explanation:
Plants had already developed sexual reproduction and relied on other methods of dispersal (probably primarily wind) when some ancestor of the modern bee happened to find that some of the reproductive parts of a plant were nutritious. Because the bee found a ready source of food, he (and others like him) left lots of progeny. Those progeny and many, many generations following had an ever increasing taste for these specific plant parts. In the meantime, those plants that had extra yummy (to the bee ancestor) reproductive parts spread far and wide, because the bees accidentally helped in the fertilizing of those particular plants.
It’s like a gigantic boulder that slow starts to roll downhill – as it moves along, the speed increases. As plants and bees slowly gain an edge (as far as survival and reproduction go), the changes that create the interdependence between plants and insects become more and more striking, even in some cases resulting and two completely disparate species that cannot survive without the each other.
Nature never ceases to astonish.