If I use the concept of virtual ground in a basic op amp circuit I end up with zero gain
The assumption that V+ and V- are both equal to each other requires that the gain of the opamp be infinitely large and that the opamp be connected in a negative feedback configuration. This is because the negative feedback, with the help of the large gain, will try to equalize the two inputs.
Now when you try to use the standard differential amplifier equation,
$$V_{o}=A(V_+-V_-)$$
where \$A\$ is the opamp gain,
you make the implicit assumption that \$A\$ is not infinite. Otherwise, this equation does not mathematically make sense.
To see how the feedback network determines the operation of the opamp, consider the transfer function of an amplifier with negative feedback:
$$H=\frac{A}{1+Af}$$ where \$A\$ is the amplifier gain and \$f\$ is the gain of the feedback network. If \$A\$ is extremely large, \$1+Af\approx{}Af\$ and we get
$$H\approx\frac{1}{f}$$
Thus, the transfer function entirely depends on the feedback network.