To do this, you do have to do 2 separate residencies.
Not necessarily. As noted above, there are combined residencies and as a matter of fact, we have a forum for such here at SDN! Most common are Med-Peds, Neuro-Psych, EM-IM, etc.
For example, if you wanted to be a IM doc and a radiologist, that's 6 years there. 3 for IM (PGY-1 + 2 of residency), then 3 of radiology.
Not to be too pedantic, but a full Radiology residency is 5 years which does include a Prelim Med or Surg year. So if you wanted to do both IM and Rads it would 3 for IM and 4 for Rads (since you could count your first IM year as your Prelim year for Rads), for a total of 7.
I am conjecturing here, but for the peds specialties I think you pretty much have to do a peds residency and your specialty residency (e.g. peds anesthesiology).
Not necessarily. There are fellowships. In the example you gave above, you would do an Anesthesiology residency followed by a Peds Anesthesia Fellowship; the same holds for EM - there are EM Peds fellowships, etc. Now these people are not qualified to take the Peds Boards (which would require completing a full Peds residency) nor would be they be qualified to take care of Pediatric conditions outside the scope of their training...ie, you wouldn't see a Pediatric Anesthesiologist doing general peds or well baby checks. And most wouldn't want to.
You will see Surgeons who have done Critical Care fellowships, Pulmonologists who have done the same or Sleep Medicine training, Vascular Surgeons who do some Interventional Rads/Angio, etc.
In general, outside of the scope of the formal combined residencies, most people do not do two residencies in two disparate fields because it would be hard to find time to focus on the minutiae of each specialty and to do it well. Besides, who wants to do two residencies unless they really have a change of heart about what they want to do with their life and career?