We report a numerical investigation of two colloids immersed in a critical solvent, with the aim of quantifying the effective colloid-colloid interaction potential. By turning on an attraction between the colloid and the solvent particles we follow the evolution from the case in which the solvent density close to the colloids changes from values smaller than the bulk to values larger than the bulk. We thus effectively implement the so-called (+, +) and (-, -) boundary conditions defined in field theoretical approaches focused on the description of critical Casimir forces. We find that the effective potential at large distances decays exponentially, with a characteristic decay length compatible with the bulk critical correlation length, in full agreement with theoretical predictions. We also investigate the case of (+, -) boundary condition, where the effective potential becomes repulsive. Our study provides a guidance for a design of the interaction potential which can be exploited to control the stability of colloidal systems.