In German there are cases where you use an expletive subject. This subject is not the 'real' subject of a semantical point of view. It's merely the grammatical subject when no real subject is present.
Es geht mir gut.
In both sentences es doesn't refer to anything in particular.
There are a couple of questions on this site about this; thus, I'm not going any further on this topic.
So, your question is about the grammatical case. Es is the subject and in the nominative case.
Dir, as you correctly assumed, is the dative object.
On a side note: It's true that most often the accusative object is considered the direct object and the dative object is regarded as the indirect object. But I suggest to refrain from using the English terms and comparing those. There are exceptions, e.g. "Ich danke dir" vs "I thank you".
Finally, "Wie gehst du" and "Wie gehen Sie" is correct German, but has a totally different meaning. Gehen has the meaning of to go, to walk. You could, for example, ask this question if you someone walks in a strange way (let's say his leg aches and he's limping slightly).
"Wie gehst dich" is just improper in German. You would understand gehen in the sense of to go (Du gehst), again, but the pronoun dich would be just the wrong one.