Not sure where in the world you live but I'm in a sub-tropical area of Australia and had a moderate cockroach problem in my house for years (they were a large species). I have a big old PC case which I open for some reason or another every few months and only ever had dust and sometimes spider web. I once had an entire ant colony infest my oculus rift box (goes to show how useful I found it haha). NOT ONCE any sign of cockroaches in my PC.
However, 18 years ago I had a job servicing touch screen terminals in restaurants, where the restaurants had cockroach problems - and those terminals were bad. The roach activities would short out circuits (including in other appliances like dishwashers - they nest in the warm control boards). These however were a smaller bodied species of roach to what most houses in my region get.
So my life experience on this one: IF you have SMALL cockroaches in your house, then they will move into your PC and other appliances, and any efforts to stop them getting in probably aren't worthwhile. Best advice: keep your house clean, especially the kitchen. Crumbs left on the benchtop overnight would be enough reason for roaches to stick around.