I agree that "How do you do," could sometimes be used in formal situations, like in business, but maybe only by people who are middle aged. I can't imagine myself or someone my age using "How do you do" even in the most formal context, we would just say "How are you?" with a more polite tone. My experience is in the U.S. though; I've heard the UK is super formal, so maybe it is more commonly used still over there or in Australia.