I believe you can do this pretty easily with
Extended Audio File Services (of course, "easily" is a relative term when Core Audio's involved

). My understanding is that the ExtAudioFileWrite function will convert the data using the Converter audio unit to the format specified by the AudioTypeID if it's different from the actual data format. You could also do this manually by setting up an AUGraph with a Convert unit, but I believe ExtAudioFileWrite will do the hard work for you.
I haven't had a need to try this myself yet, so I'm afraid I can't offer much help on the specifics. There seems to be some discussion on this on the coreaudio-api list, though, so that might be a good place to keep looking.