The calculations of the dimensionless layer monomer density profiles for a dilute solution of phantom ideal ring polymer chains and star polymers with f = 4 arms in a Θ-solvent confined in a slit geometry of two parallel walls with repulsive surfaces and for the mixed case of one repulsive and the other inert surface were performed. Furthermore, taking into account the Derjaguin approximation, the dimensionless layer monomer density profiles for phantom ideal ring polymer chains and star polymers immersed in a solution of big colloidal particles with different adsorbing or repelling properties with respect to polymers were calculated. The density-force relation for the above-mentioned cases was analyzed, and the universal amplitude ratio B was obtained. Taking into account the small sphere expansion allowed obtaining the monomer density profiles for a dilute solution of phantom ideal ring polymers immersed in a solution of small spherical particles, or nanoparticles of finite size, which are much smaller than the polymer size and the other characteristic mesoscopic length of the system. We performed molecular dynamics simulations of a dilute solution of linear, ring, and star-shaped polymers with N = 300, 300 (360), and 1201 (4 × 300 + 1-star polymer with four arms) beads accordingly. The obtained analytical and numerical results for phantom ring and star polymers are compared with the results for linear polymer chains in confined geometries.