DNA is the molecules (i.e. the letters) that forms the genetic material.
The genetic code is the instruction for the cell to make molecules. It is the all the nucleotide triplets (codons) that code for their specific amino acid.
A genes is a group of codons (nucelotide triplets) that code for a protein. The gene is what controlled the inheritence.