Assuming they are alive.
First, turn the computer off, move it to a closed space and spray into the space with bug spray (not directly onto the computer). Give it around half an hour to do its thing and then let the area vent (make sure not to breath it in). Take your PC to an outside area with a bin to dispose of the roaches. Depending on how bad it is, you might need some gloves and a stick to dislodge all the roaches, and you will have to remove all the components to make sure there are no dead roaches hiding behind the motherboard and other such crevasses. Once you have all the roaches out, you'll want to hit everything with canned air duster.
Once you're done cleaning it, you'll want to spray the area around where the computer...