This is assuming you're in the USA; I've heard it's different elsewhere.
If it's a person you don't know well, it's just a greeting that's roughly equivalent to "hello." They're not actually asking about your well being. The less well you know them, the more true this is. If it's someone you have zero personal connection (like a client or customer you've never seen before), they absolutely expect a response of "good, and you?" They often won't even listen to your response; countless times, I've simply said "hi" back and still had them respond as if I had asked the question back. If it's a colleague you occasionally run into in the hall, but don't know well, the same applies. I personally hate this custom, because I hate having to lie, especially about feeling miserable, but that's what's expected.
However, if it's a colleague that you sit next to, and the two of you regularly share what's going on in your life, then they will likely appreciate an honest answer. Same goes if it's your best friend or mother asking, obviously!
As a general rule of thumb, consider what the person has shared with you in the past. If they've shared feeling down, then they likely won't mind if you do the same. If you have no idea what's going on in that person's life, then give them a smile and tell them you're doing great, regardless of the truth.