How to attach a metal bearing to a print
Ball bearings are usually fitted in one style, no matter what is the material that they are embedded in: press fit.
Press fit
To get a good press fit, the part will have to have a hole that is the diameter of the bearing (22 mm) plus a little margin that depends on your printer and filament. From my own experience, a design with 22.1 mm to 22.4 mm diameter resulted in a near-enough 22mm hole that gave decent fit. Your design will need to be adjusted depending on the material and resolution of the printer.
Note that in the case of machined metal parts, the hole usually is not exactly 22mm but a coupe thau (=1/1000 inch) smaller as the bearings get pressed into the hole with a hydraulic press. They do deliberately deform the bearing and workpiece a tiny bit to sit perfectly. If you make the hole too much too small, the printed parts could break under the stress such treatment puts them under. However, if done just right the ring itself will deform just enough to fit the bearing's casing, as long as it is flexible enough. I have experienced prints of 2 wall thickness with 15-20% infill to allow a little bit of flex, which resulted in them applying quite some tension on a set of three screws: the Slider for 2040 Openbuild V-slot by FabianFriethjoph does use this effect from PLA to force the wheels into the guide rail just enough to prevent wobble.
Since most filaments shrink, you might still need to use a larger-than 22 mm hole in design to get just a couple thau under the 22 mm you want for the perfect press fit.
Adjustable position
In some cases, ball bearings are fitted into larger holes, and then fastened and adjusted with a set of 3 setscrews - their seat can be changed slightly to compensate for warp or shear of the whole item. However, printed plastics are bad at holding a thread, and it would be a very good idea to include a metal insert with the thread. For example, you could include a nut in the middle of the ring holding the bearing, or you might use metal inserts.
Capping
Even if one uses a snug press fit or adjustable position, it can be a good idea to use a cap that makes sure the bearing can't fall out of its area without removing the cap first.