Aims. We study the mean number counts and two-point correlation functions, along with their covariance matrices, of cosmological surveys such as for clusters. In particular, we consider correlation functions averaged over finite redshift intervals, which are well suited to cluster surveys or populations of rare objects, where one needs to integrate over nonzero redshift bins to accumulate enough statistics. Methods. We develop an analytical formalism to obtain explicit expressions of all contributions to these means and covariance matrices, taking into account both shot-noise and sample-variance effects. We compute low-order as well as high-order (including non-Gaussian) terms. Results. We derive expressions for the number counts per redshift bins both for the general case and for the small window approximation. We estimate the range of validity of Limber's approximation and the amount of correlation between different redshift bins. We also obtain explicit expressions for the integrated 3D correlation function and the 2D angular correlation. We compare the relative importance of shot-noise and sample-variance contributions, and of low-order and high-order terms. We check the validity of our analytical results through a comparison with the Horizon full-sky numerical simulations, and we obtain forecasts for several future cluster surveys.