The IRAM/GISMO two-millimeter survey in the COSMOS field