We model the distributions of firm sizes and of firms' total factor productivity (TFP) as outcomes of a market equilibrium from the occupational decisions of individuals with different entrepreneurial skills, of working as employees, employers or solo entrepreneurs. The model explains empirical regularities such as: i) the positive crosssection correlation between average size of firms and average labor productivity of countries; ii) the positive association between size and TFP of firms in an economy; and iii) the power law distribution of firm sizes. Two parameters of the model, one that measures the organizational size diseconomies, and other related to the dispersion of the distribution of entrepreneurial skills in the population, appear as main determinants of the differences in firm sizes and in productivity, across economies and among firms within an economy. The results of the paper should be of interest for the design and evaluation of firm-size dependent policies.