W and Z studies at CMS