A microscopic description of nuclear molecules: Application to the 12C + 12C system