This phrase, occasionally rendered as "How are you hanging?", can be used as a greeting, a query of state, or some combination of the two, much along the lines of "What's up?" or "How do you do?" Much like these questions, a literal response it not usually appropriate, unless the intent is humorous. When used as a greeting, probably the most common usage, the response may be similar to a response typical to any other greeting, including the above greetings, or a brief summary of the state of being of the respondent.
The implicit antecedent of the "it" is the male genitalia. In the alternate form ("How are you hanging?"), the subject is still the same, this being a shortened form of "How are you(r genitals) hanging?" This is important to understand, because even though the question is not usually intended to be answered literally, it may be considered inappropriate to use with people lacking such appendage, e.g. girls, eunuchs, asexually-reproducing protozoa.
It may seem that much can be made of the fact that the speaker of this phrase appears to be interested in the orientation of the genitals of another. Despite appearances, this phrase is not typically used as a come-on or pick up line. The choice of this phrase may be indicative of the male concern with their and each others' genitals, and the close relationship between a man's genitals and his well-being.
The phrase may seem archaic, since in the modern age, men's genitals do not "hang" particularly, unless they are naked, going commando, or wearing a kilt. Perhaps this phrase is a throwback to a simpler age, when man occuped a state of nature, and his genitals did in fact hang frequently, and well-hanging genitals were, in fact, a sign of well-being. Nevertheless, the phrase is now a colloquialism, all but stripped of its original message.