I've solved the problem.
It's somehow related to the graphics card producing signal noise which the sound card picks up, or at least that's how I understood it.
The cause of the problem was that I had disabled Vertical Sync in my program and the refresh rate was causing the problems that way.
I've re-enabled Vsync in my program and the issue has gone.
Thanks for the help anyway!