Not sure what use you have in mind.......but molding seems a good place to start. There are all kinds of nylon, metal, glass spheres for the ball. The socket, I'd mold in JB Weld, Brownells Micro Bed or similar 2 part epoxy compounds. Coat the ball with paste wax, and inside of the 'box' form of the socket. It'll pop right out when cured.
Another way would be to contour a ball brazed on a smaller diameter shaft, and use a machinists 'ball end mill' to cut the socket. If you go beyond the radius of the cutter, and out side wall thin enough that can be hammer tapped to hold the ball in place. We make replacement pads for large expensive C-clamps in precisely that way.
Email me and I'd be happy to assist further.