Submit a soil sample to your local university extension. Ask workers there to analyze the sample and provide feedback on your topsoil's composition. Read the report completely before beginning to amend or repair your topsoil.
Amend your soil with lots of compost and organic materials. Work them in to the soil with a mechanical tiller until the topsoil is loose and drains well. Apply a nitrogen-based fertilizer to help accelerate the decomposition of the organic material. Address any severe deficiencies your soil test revealed by following the university extension's specific recommendations.
Plant a green manure cover crop, such as clover, in the garden that you've amended. Water it and encourage it to grow. Plow it under before the flowers are completely formed to get the most benefit from the plant materials. Retest the soil after plowing; if it is significantly improved, you can plant a garden in that location. Repeat the amendment process if the soil is still severely deficient, and continue to grow green manures or legumes.