TL;DR: When pinging anything and having USB in front IO the ping gives request timed out or time between 1000ms and 3000ms. When disconnecting USB this goes immediately to 1ms. When all request are being timed out, the WiFi is not even capable to connect to WiFi hotspot which is right next to PC.
I have experienced very weird behavior of my PC for quite long now. Whenever I plug in a USB to front panel of PC, the WiFi connection gets very laggy up to a point when sometimes it just doesn't work at all.
This however does not happen 100% of time when using front IO.
Here is a image of me pinging my router while USB is connected. (Nothing is being done - no programs opening, only youtube music playing in background.)

After this ping finished I disconnected the USB and imminently ran another ping.

While in the Images I presented it isn't as terrible (other than request timed out)
While this screenshot I presented here isn't as bad as some lags I experienced before (Request timed out all time or all pings probes above 1000ms reaching 2000ms until I disconnected USB)
I also have tried to make WiFi hotspot from my phone, which I placed directly on the PC itself, and connect to it, while all requests were timed out once. This resulted with WiFi could not connect error. The Wi-Fi card however never actually turned off itself, and OS can always see it, even after 30 minutes of request timed out and USB in front IO.
The PC I am using is HP 550-106na, with upgraded PSU to 420W and R7770 as a graphics card. The OS I am using is Windows 7.
I am wondering what could cause this weird behavior of the USB and WiFi card, and what could be possible solution for me?
Other common issues I experienced that may be related.
If this helps at all I experience similar lag when unplugging my headphones - it takes my PC sometimes up to 2 minutes to detect that the device was disconnected, and switch to speakers connected from the back. However connection is detected instantaneously. The main difference between headphone jack and USB is that the lag with headphone jack is happening 100% of time, while USB issue is happening randomly.
Another thing that I experience very rarely is that after power cut sometimes my PC is unable to see any WiFi networks nearby, the fix for that is always power off, unplug power, hold power up button for around 10 seconds and then power back up.
This question is not a duplicate of Wi-fi turns off when USB device is plugged in, as the WiFi card does not actually turn off - it is still present and system can detect it, however no packets can actually be submitted.