I don't know the rules, because if I did know them, I'd expect I'd ignore them.
Personally, I really dislike this aspect of 3.Xe. One of the big problems with it is that it almost guarantees that if you challenge PCs with NPCs that have wealth baked into their assumed CR, that the PCs will quickly exceed the wealth by level for PCs meaning that the PCs will themselves have above their assumed CR. In general, my NPCs tend to have much less than the suggested wealth by level, and consequently I on an ad hoc basic tend to reduce NPC CR by about 20% on that grounds alone. And on top of that I tend to assume NPC CR is lower than suggested even if the NPC has the suggested wealth by level, based on experience with what actually challenges PCs. One big problem here that is unstated is that class balance is so weak in 3.X and 3.5 especially, that whether the NPC CR lives up to its rating highly depends on the DM spending a lot of time in optimization - or at least as much time as the PCs spend on optimization. That for me is an unpleasantly limiting constraint.
Even worse at least from my perspective, it requires heavy GM metagaming to work 'right'. In published modules this is most often seen as the assumption that the NPC has in place at the beginning of the combat a large number of short term abilities gained by expending a variety of one shot consumables just before the fight - regardless of how the PC's have behaved. This gives the NPC the required boost in abilities to be a credible threat, without boosting the PCs above the wealth by level assumptions. But if you 'play fair', it's ridiculous in practice. If the PC's have surprise, without the boosts the NPC is a cake walk compared with a similar foe of the same CR that doesn't depend on consumable gear to be a threat. If the PC's don't have surprise, they can easily metagame the NPC - noisily threatening to attack the NPC, then simply waiting 10 or 20 minutes for the bosses boosts to wear off before actually kicking in the door. Unless you are willing to pretend the NPC has perfect mind-reading abilities, the perfect timing of quaffing all those potions, reading those scrolls, and so forth is pretty silly. (On the other hand, I have NPCs that do this sort of thing to the PCs, hiding for 10 minutes until PC's buffs wear off, or retreating with the plan of counter-attacking 12 hours later.)
However, to directly reference your question, I think that in general the NPC wealth by level would only produce the results the system assumes if the wealth by NPC level was based on the CR of the NPC. It's CR that is the critical number in the calculation, and the one you are using on a 1 for 1 basis to replace class level in deciding whether the NPC represents an appropriate challenge.
Consider the consequences of any other approach. If you base wealth by level on class level alone, then any creature with +1 CR actually gets diminished in terms of effectiveness as a threat. This is because by the rules, any difference in a creatures CR actually represents a huge difference in effective threat. A creature with +2 CR is supposed to be TWICE as dangerous as a creature without a CR adjustment - that is, the same creature could replace two creatures with the same class levels without a CR adjustment and the threat of the encounter is supposed to be the same. If you look at wealth by level, that's baked into the assumptions. Wealth by level goes up at an exponential rather than linear rate. If the Drow in the above example that is supposed to replace say a human 11th level sorcerer as a threat doesn't actually get the same equipment as the 11th level human sorcerer, then I doubt his racial bonuses will make up the difference of both diminished class levels and diminished gear. With Drow, just because they have the traditional 'coolness' bonus, it will be close. But with less favored foes subject to designer bias, I suspect it will not. The result will be less reward for the win, but less challenge for the XP.
If you base it on ECL rather than CR, then all that gear will not bring up the CR high enough to justify the loot. First, the effective CR will go up, because that loot will be meaningful. But it won't go up as high as the ECL. The equipment rewards for winning will vastly the actual threat the equipment represents in the hands of the foe.
In all three of your examples, I'd base the loot on the CR. A storm giant/sorcerer 10 in theory replaces a sorcerer 18 as a threat, so the loot should be the same. Ditto every other example. This will come closest to actually representing the real threat.
In practice though, adding class levels to anything but a humanoid won't necessarily increase CR as much as adding racial HD - particularly for things like Dragon/Outsider where the advantages of racial HD are significant and there are often important abilities that take racial HD as an input in the DC to resist the ability. Ironically, the CR calculation system encourages you to see things in the reverse - counting an increase in racial HD as worth less even than a non-related class level increase in HD. And that's not the only problem with the system. In some cases the designers deliberately miscalculated CR for esoteric reasons basically amounting to 'we wanted the monster to be cool' that undermines the entire rational basis of the system. Or in short, the whole CR/LA/ECL/EL system is seriously screwed up and no DM worth his salt takes it at face value IMO. They either work around it and only create creatures and encounters where the calculations are approximately right and avoid those where it isn't, or they fudge.