The answers given so far end up being right, but I don't think the above posts have made it clear why. The average should be given by the value of a given result times the probability of that result, summed over all possible results. Let's break it down.
The probability that you roll max (on one die) N times but not max on the N+1st time is (1/D)^N*(D-1)/D for a D-sided die.
The result we should get for N max rolls is D*N + (D/2), where the D/2 is the average value of the last non-max roll (this is the same as the average roll of a D-1 sided die).
So we need the sum of this from N=0 to infinity. For simplicity, call x=1/D. Then we have
(1-x)*Sum[ x^N (N*D+D/2)].
Break the sum into two terms. The second is just a geometric series:
(1-x)*Sum[ x^N D/2] = (1-x)*(1-x)^-1 D/2 =D/2.
The first part is
(1-x)*Sum[ x^N N*D] = (1-x)*D*x*d(Sum[x^N])/dx = D*x*(1-x)/(1-x)^2 = D*x/(1-x).
Putting it all together, we have
D/2 + D*x/(1-x) = D/2 + D/(D-1) = D*(D+1)/2(D-1).
In the end, this is the same as results given by the other posters. For a d6, you get 4.2, only a little higher than average for a single roll, which is because it's hard to roll max more than once.