The equation linking $\Delta H^\circ$ and $K$ is called the van 't Hoff equation. Since Philipp's comment on your question already links to a very thorough discussion of where the equation $\Delta G^\circ = -RT\ln{K}$ comes from, I won't repeat it.
The definition of the Gibbs free energy, $G$, is $G = H - TS$. Using $\mathrm dG = V\,\mathrm dp - S\,\mathrm dT$ we obtain the Maxwell relation
$$\left(\frac{\partial G}{\partial T}\right) = -S$$
and hence the Gibbs–Helmholtz equation (derivation here)
$$\left(\frac{\partial (G/T)}{\partial T}\right) = -\frac{H}{T^2} \quad \Leftrightarrow \quad \left(\frac{\partial (\Delta G^\circ/T)}{\partial T}\right) = -\frac{\Delta H^\circ}{T^2}$$
Since $\ln K = -\Delta G^\circ/RT$, we have
$$\frac{\mathrm d(\ln{K})}{\mathrm dT} = -\frac{1}{R}\frac{\mathrm d}{\mathrm dT}\left(\frac{\Delta G^\circ}{T}\right) = \frac{\Delta H^\circ}{RT^2}$$
This is the differential form of the van 't Hoff equation; it's not the most useful thing to us though because it only tells you the slope of a plot of $\ln{K}$ against $T$ at one given point. We usually separate the variables and integrate with respect to both sides:
$$\int_{\ln{K_1}}^{\ln{K_2}}\!\mathrm d(\ln{K}) = \int_{T_1}^{T_2}\!\frac{\Delta H^\circ}{RT^2}\,\mathrm dT$$
$$\ln{K_2} - \ln{K_1} = \frac{\Delta H^\circ}{R}\left(\frac{1}{T_1} - \frac{1}{T_2} \right) $$
So, if you know the equilibrium constant $K_1$ at a certain temperature $T_1$ and you want to find the equilibrium constant $K_2$ at a different temperature $T_2$, you can just plug in your values into the equation and solve for $K_2$.
Note that this equation supports what you know of Le Chatelier's principle; if the reaction is exothermic, $\Delta H^\circ < 0$, and if you increase the temperature from $T_1$ to $T_2 > T_1$ then $(1/T_1 - 1/T_2) > 0$. The RHS of the equation is therefore negative, and that means that $\ln{K_2} < \ln{K_1} \Rightarrow K_2 < K_1$ which implies that the equilibrium position has shifted to the left.
Note that the last step (the integration) makes the assumption that $\Delta H^\circ$ is a constant over the temperature range $T_1$ to $T_2$. Note that this is, in general, not true but if the temperature range isn't too huge you will get pretty accurate results from the use of this equation.