Context. Twenty-six high-luminosity IRAS sources believed to be collection of stars in the early phases of high-mass star formation have been observed in the near-IR (J, H, K s ) to characterize the clustering properties of their young stellar population and compare them with those of more evolved objects (e.g., Herbig Ae/Be stars) of comparable mass. All the observed sources possess strong continuum and/or line emission in the millimeter, being therefore associated with gas and dust envelopes. Nine sources have far-IR colors characteristic of UCHII regions, while the other 17 are probably experiencing an evolutionary phase that precedes the hot-cores, as suggested by a variety of evidence collected in the past decade. Aims. We attempt to gain insight into the initial conditions of star formation in these clusters (initial mass function [IMF], star formation history [SFH]), and to determine mean cluster ages. Methods. For each cluster, we complete aperture photometry. We derive stellar density profiles, color−color and color−magnitude diagrams, and color (HKCF) and luminosity (KLF) functions. These two functions are compared with simulated KLFs and HKCFs from a model that generates populations of synthetic clusters starting from assumptions about the IMF, SFH, and Pre-MS evolution, and using the average properties of the observed clusters as boundary conditions (bolometric luminosity, dust distribution, infrared excess, extinction). Results. Twenty-two sources show evidence of clustering with a stellar richness indicator that varies from a few up to several tens of objects, and a median cluster radius of 0.7 pc. A considerable number of cluster members present an infrared excess characteristic of young pre-main-sequence objects. For a subset of 9 detected clusters, we could perform a statistically significant comparison of the observed KLFs with those resulting from synthetic cluster models; for these clusters, we find that the median stellar age ranges between 2.5 × 10 5 and 5 × 10 6 years, with evidence of an age spread of the same entity within each cluster. We also find evidence that older clusters tend to be smaller in size, in agreement with our clusters being on average larger than those around relatively older Herbig Ae/Be stars. Our models allow us to explore the relationship between the mass of the most massive star in the cluster and both the cluster richness and the total stellar mass. Although these relationships are predicted by several classes of cluster formation models, their detailed analysis suggests that the properties of our modeled clusters may not be consistent with them resulting from random sampling of the IMF. Conclusions. Our results are consistent with star formation having occurred continuously over a period of time longer than the typical crossing time.