You have to have two cards that have the exact same chip for both nvidia and ati.
nvidia:
Generally, nvidia's card numbering is pretty spot on. The first number obviously indicates which series it is. The other are an indirect indication for the amount of shader units and clock speeds. GTX 550, 560, 570 and 580 are all different from each other if you look at their chips. Although some of them do use the same chip, nvidia disabled a certain amount of shader units depending on the card. That is what they do though, they design a high end chip that will be on their top tier card. When they've released that they will use that same chip for lower ranked cards and just tinker around with the shader units and clock speeds.
Some examples:
GTX 460 + 470/480 - not going to work (shader unit amount difference)
GTX 460 + 460 - will work, no matter the manufacturer and clock speeds (fastest card will be clocked to the slowests' card speed.
ATI's card numbering on the other hand is a bit different. Generally their numbering consists of 4 numbers. For example the ATI 6950: the first number indicates the series number, the second indicates the sub-series number and the last two indicate the version of the card.
For ATI crossfire it is possible to say crossfire a 6950 with a 6970. Those two cards are identical in chip but differ in clock speeds. In this case they will both run at the speeds of the slowest card. You cannot crossfire a 6850 with a 6950 or 6970. So in most cases, as long as the first two numbers of the card are the same you will be able to crossfire them.
Examples:
HD6950 + 6950 - works (clocks of slowest card will be used)
HD6950 + 6970 - works (6970 will run at speeds of 6950)
HD6850 + 6950 - will not work, chips are different and thus wont work in crossfire.
There is a technology though that allows ANY card brand to be used together. This is called Lucid Hydra and is implemented on some high end motherboards. This allows you to run a GTX580 with a HD6970 for example. It's still in a very early phase though and I wouldn't recommend it to anyoneone. But it might turn out quite nice in the future.
Hope to have cleared stuff up
:
P.S. Merry Christmas