The monarch is accompanied by his spouse and trade liaison regardless of pop cap. The actual entourage is affected by pop cap though, and will not come if this cap is reached (which often happens at this stage). It's a good idea to have archive saves somewhere, and if such situation happens, go back to that last save, increase pop cap, and wait for the monarch: you should get all entourage with next try.
And this entourage is a word used loosely, in reality it accounts of a few high level fighters (four in my case, usually), and a bunch of different civilians (about 30 last time). Now, barons are not part of this, and they will visit you as always, as before the monarch came, and then go home. This also includes diplomat (who doesn't come with the king, unlike the outpost liaison), who will visit your inn from time to time, but then always leave. The same with general.
Some visitors can come and be stuck - I have such a baroness, and she hijacked my diplomacy, despite being initially lame as hell in this regard - all human and elven diplomats go to her, instead of either my king or my duchess. But she is somehow messed up, being a part of a government of CITY A, and being titled as baroness of CITY B, this happened about time when the duke of CITY A got whacked by goblins during visit in my fortress. She never leaves, but I cannot assign a room to her, so it's a bug. Also some consorts may visit and actually become citizens of your fortress, after usual two years period. But I wouldn't count on counts (and barons and dukes). They will come and go, as tourists, or to visit they lovers (yeah, I have a fortress of sluts).
Now you mention lieutenant and captain - I don't think that lieutenant is a part of vanilla game in dwarves, while captains are associated with a particular city, not a civ. So you either have a modded game, or something strange happened.