Using natural earthquakes and the use of seismic surveying are the 2 major ways of determining layers for the first ~ 5 km of crust.
Tho it doesnt specifically tell you what those layers are made of it does tell you about the thickness of each layer, depth below surface and velocity factor of each layer ( from which you can make educated guesses of the type of rock the different layers are)
When i was doing my BSc in geology at Uni, part of the course was learning to interpret seismic surveys
just a little correction... phinds commented on the crust being 10's of miles thick, whilst this is correct for the thickest parts of continental crust, it isnt for oceanic crust which avg's ~ 10km (6 miles) thick. Which is what you originally asked about.