Glucose production from carbon dioxide gas and water takes place in plants and is carried out through the process of photosynthesis. Microscopic life forms, such as bacteria, actually consume (or metabolize) glucose for their energy and other requirements.
The generation of glucose through photosynthesis requires light energy (provided by the sun) and the reaction is given as:
6CO2 + 6 H2O + light energy --> C6H12O6 (glucose) + 6O2
This reaction is also very significant for the amount of oxygen and carbon dioxide in the atmosphere. We prefer more oxygen and less carbon dioxide for our healthy sustenance. The same reaction also provides food (and in turn energy through the breakdown of glucose) for all the higher life forms.
This reaction is assisted by chlorophyll, a pigment contained in the chloroplast.
Hope this helps.