Cosmic voids are large underdense regions that, together with galaxy clusters, filaments and walls, build up the large-scale structure of the Universe. The void size function provides a powerful probe to test the cosmological framework. However, to fully exploit this statistics, the void sample has to be properly cleaned from spurious objects. Furthermore, the bias of the mass tracers used to detect these regions has to be taken into account in the size function model. In our work we test a cleaning algorithm and a new void size function model on a set of simulated dark matter halo catalogues, with different mass and redshift selections, to investigate the statistics of voids identified in a biased mass density field. We then investigate how the density field tracers bias affects the detected size of voids. The main result of this analysis is a new model of the size function, parameterised in terms of the linear effective bias of the tracers used, which is straightforwardly inferred from the large-scale two-point correlation function. This represents a crucial step to exploit the method on real data catalogues. The proposed size function model has been accurately calibrated on mock catalogues, and used to validate the possibility to provide forecasts on the cosmological constraints, namely on the matter density contrast, $Omega_{rm M}$, and on the normalisation of the linear matter power spectrum, $sigma_8$, at different redshifts.