The problem: after connecting Arduino to PC via USB in 5-7 seconds IDE says that connection is losted.
Yes, that's normal. That's the bootloader running, and it's during that 5-7 second window that you can upload a new sketch.
Under normal circumstances the IDE will automatically reboot the board for you so the upload time window coincides with the IDE's attempt to upload a new sketch. However under some circumstances it can't, so you have to do it manually by pressing the reset button at the right time.
Also on Windows you may find that you have a different COM port for programming as you do when a sketch is running (Windows is retarded like that, you see). The IDE tries to do some magic to identify the correct COM port to use, but you have to first have the correct "sketch mode" COM port selected so it can first reboot the board into the bootloader, at which point it tries to do its magic to work out the correct COM port to use by looking to see which COM port (if any) has just appeared since rebooting.
So, in short: if the IDE can't reboot the board for you then do it manually, but note that timing is vital. Press the reset button a few moments before
avrdude runs. It may take practice.