One example of an intelligent species that keeps a caste system is humanity. Over large parts of the globe and huge spans of history, women where pushed to work in the domestic sphere, and where often pushed out of certain castes (warfighting beeing the prime example). Never uncontested, never to 100% effect but the push was and is there. But that's not what you are asking about.
I think your concept faces several big questions:
* How did it come about?
* What is the relationship between queen and hive?
* How does it work energy wise?
I think <PERSON> answer contains an excellent idea that I will borrow, distort, and build upon - long lived foragers who learn and aquire some intelligence. At one point in their life, they become to frail to go on forageing, language developed partially through imparting experiences on the younger flock. The elders (as I will call them from now on) mostly sit at the nest. Not every member, not even a majority, reaches this age. If need be the elders allow some culling among their young ones (and possibly among themselves). This is one solution to the energy puzzle. The other one is that these beasts are very efficient foragers and activly terraform (to a greater extent than even beavers or certain ants do so) their environments.
Because all worker castes are essetnially the same animal they share the same capability to learn and think. 121
Also, more brainpower turns out to be useful in nest building or rearing the young (for example only foragers need language but the language skills develop faster when the specialized nursing cast also has language capability). So at first, the more capable brain is about as useful as male nipples for these non-foraging castes, but once language enters the game, these capabilties become useful and are selected for.
The queen is not necesarily as intelligent, because laying eggs does not require much thinking. If intelligent, they could be one of the elders. Or they would be the egg laying machine, adminstered by the elders.
In this answer I treat the elders as a homogenous group. What social structures they give themselves is pretty open. There could be ruling clique of relativly youg, strong elders or even one strong'man'. There could be an athenian style democracy. There could of course be a roughly egalitarian society, this is even likely. One thing that was very important in early civilizations, possession (or right to use land) that could be passed down through the generations, would play no role in a hive. It will be an interesting question what, then, the chief conflicts ithin such a society will be about. 164