I have one that's a USB device to use with my laptop that works fine, but it's too big in diameter to fit anything much smaller than a .38 bore and its fixe focus is too far away for a good barrel inspection.
I did get a gadget with a child's microscope that works fairly well. It's just a plastic plate with a short tube whose ID is slightly over the OD of a typical eyepiece. The other side is an array of little suction cups. You stick your cell phone to the suction cups so the camera lens is centered in the tube, and you can then take photos through the microscope or, as it turned out, through my Hawkeye borescope. Pretty simple and effective and you could gin up such a thing for yourself out of wood and plastic. You might not have the suction cups, but those are just because they don't know what diameter phone is going on there. You know your phone and could make a pocket for it.