OK lets start at the beginning with regard to the USB.
First off you need to make sure you have downloaded the drivers. To do that go to the downloads section at the top of this page and follow through and download Line6 Monkey. Once you have downloaded that and set up the drivers you need to download Gearbox (again from the download link). Gearbox is the editor software that the X3 series use.
A word of advice. When setting up make sure you use a good quality USB and make sure that you don't connect vis a USB hub (this includes the internal hubs that some desktops use to feed the front USB ports on PC's - to be on the safe side use a rear port).
The above steps will allow you to start creating patches. You can also use it to see how other patches are constructed - either the default patches or those downloaded from custometone - custometone is also available at the top of this page.
With regard to recording via USB I am going to assume that you already have a DAW (Reaper, Cubase, Ableton etc.) if not then you could do worse than downloading Reaper from Cockos software which is free to try and is very inexpensive to purchase.
When you set up your drivers at the beginning of this post it would have sup up the Line6 ASIO drivers. These are what you need to use in your DAW.
For example in Reaper you create an audio track, make sure that your audio device in preferences is set to the Line6 driver and then arm the track.
Recording is a huge subject in itself and I would suggest if you have questions regarding recording that go beyond how to set up the line 6 audio device that you go to the forum relevant to your particular recording software as they all have slightly different ways of doing things.
Lastly - HAVE FUN - I think the X3 is excellent for recording, in particular you can record a dry signal (IE a guitar that has no effects applied) and then apply effects to the sound retrospectively. To do that you need to download Podfarm (again from the link at the top of the page - or you can do it through Line 6 Monkey). The X3 gives you a free licence for Pod Farm 1 and all of the expansion packs, and if your X3 was purchased new after September 2009 you are entitled to a free licence to Pod Farm 2.