The electronic and optical properties of zincblende ZnX(X=S, Se, Te) and ZnX:Co are studied from density functional theory (DFT) based first principles calculations. The local crystal structure changes around the Co atoms in the lattice are studied after Co atoms are doped. It is shown that the Co-doped materials have smaller lattice constant (about 0.6%-0.9%). This is mainly due to the shortened Co-X bond length. The (partial) density of states (DOS) is calculated and differences between the pure and doped materials are studied. Results show that for the Co-doped materials, the valence bands are moving upward due to the existence of Co 3d electron states while the conductance bands are moving downward due to the reduced lattice constants. This results in the narrowed band gap of the doped materials. The complex dielectric indices and the absorption coefficients are calculated to examine the influences of the Co atoms on the optical properties. Results show that for the Co-doped materials, the absorption peaks in the high wavelength region are not as sharp and distinct as the undoped materials, and the absorption ranges are extended to even higher wavelength region.