How does geothermal heating work?
There are currently two ways to extract geothermal energy: one mainstream, one still at the experimental / demonstration level.
Pollack et al (2010) estimate the global geoethermal heat loss at 44 TW (by comparison, civilisation's rate of energy use is about 20 TW).
As the USA Department of Energy notes, all methods rely on the combination of three factors:

heat underground,
fluid to carry the heat to the surface, and
permeability to allow the fluid to flow.

The mainstream geothermal method
This happens close to tectonic plate boundaries. Reservoirs of hot liquid are tapped, to bring the hot fluids to the surface. Typically the temperature of the fluids is well over 100 &amp;degC;, and can be used for electricity generation, as well as for heating.
The experimental method is Hot Dry Rock
aka Enhanced Geothermal System or EGS.
As Pavel V. commented, this is being piloted in the Czech Republic, amongst other places, and allows geothermal heat extraction from places that are not close to tectonic plate boundaries. From that link:

the projected depth of the ... borehole was between 2100 and 2500 m. The drilling diameter ranges from 393,7 mm for the starting upper section to 152 mm at the borehole bottom

One tube is placed inside another, inside the borehole. Water can be injected down the inner tube, and returned up through the gap between tubes, or the other way around.
That paper reproduces the following chart from Šafanda, J., Dědeček, P., Krešl, M., Čermák, V. [2007] Report from geothermal research for PVGT-LT1 (in Czech):

As you can see, these temperatures are much lower, so are unsuitable for electricity generation, because one must accept very low efficiencies (Carnot's Law). They are used for space- and water-heating.