This is the formula you would use to calculate this. 6% is assumed to be compounded monthly.
FV=P{[1 + R]^N - 1/ R}
FV =500 x ({[1 + 0.06/12]^(30*12) - 1} / [0.06/12])
FV =500 x ( 5.0225752 / 0.005)
FV =500 x 1,004.52
FV =$502,257.52 - The balance in your account after 30 years @ 6% comp. monthly.