user26879: I'm using the Teensy 2.0 (atmega32u4) and decided to switch from Arduino IDE with Wiring to pure C. I think it's much more useful to master programming microcontrollers on that level. Wiring seems to be quite limited at some point.  
It was really easy to use some basic libraries such as avr/io, or util/delay and write simple programs like "arduino hello world".
My problem comes with more complex tasks such as acting as usb mouse. On http://pjrc.com are references just to use with arduino ide/wiring. I couldn't find anything useful on google. Is there any good reference for pure C programming tennsy/arduino and/or using libraries such as "usb_mouse.h" (from pjrc.com) with pure C?

EDIT 1
Let me add some details (based of @st2000 answer).. Yes, Tennsy (and Arduino) are microcontrollers, not microprocessors. Programming avr chips in pure C doesn't require so much work as programming microprocessors. This is the simplest avr C program I could come with (typical blinky):
#include <avr/io.h>
#include <util/delay.h>

int main(void) {
        (CLKPR = 0x80, CLKPR = 0x00);
        DDRD |= (1<<6);
        PORTD &= ~(1<<6);

        int sviti = 0;

        while (1) {
                if (sviti)
                        PORTD |= (1<<6);
                else
                        PORTD &= ~(1<<6);
                sviti ^= 1;
                _delay_ms(40000);
        }
}

As you can see (@st2000), there are no dozens of setting up registers. It does not require any expensive equipment to upload resultant .HEX file - for teensy the only thing you need is a USB cable.
If you want a concrete example, I want to use this library with pure C, but it's obviously meant for wiring and arduino IDE primary. So how to use this library with pure C? And back to my main question, how to generally use libraries of this kind with pure C avr programming?

user20245: Refer to the actual processors used on the platforms to find reference material for ordinary C or C++ programming.  There are different processors used on various Arduino boards.  Be aware that this approach normally requires programming hardware which range from a few dollars to hundreds of dollars.  Also be aware that "bare metal programming" requires the programmer to setup the processor's resources of interest.  This normally involves setting dozens (as in the Arduino Uno AVR processors) if not thousands (as in Arduino Zero's ARM processors) of registers which can deal with everything from the processor's clock to interrupt vectors.
USB programming is very complex.  Consider the complete description of RS232 could be contained in a white paper.  The equivalent for USB would be at least a book.  To simplify your efforts, we can eliminate all USB Host features as a mouse is a peripheral or USB Device.  Further, you will probably want to limit your USB Device to a USB HID or Human Interface Device.  This allows most OSs to easily recognize and use the mouse as the HID definition is more complete / restrictive. Also note, embedded processors which happen to have a USB port usually only support USB Devices as USB Host requires additional features & resources.  Now that the scope of USB support has been narrowed, you can start searching through the different processor's libraries for what you need to create a USB HID Mouse.

user30005: 
And back to my main question, how to generally use libraries of this kind with pure C avr programming?

just as how you would write under arduino ide -> arduino ide is nothing but pure c/c++ plus a set of canned libraries. so what you are trying to do is no different from what you are doing with arduino right now, maybe with your own libraries or libraries from folks other than the arduino folks.
nothing magic about going in "pure c".

26879: <p>I'm using the Teensy 2.0 (atmega32u4) and decided to switch from Arduino IDE with Wiring to pure C. I think it's much more useful to master programming microcontrollers on that level. Wiring seems to be quite limited at some point.  </p>

<p>It was really easy to use some basic libraries such as <em>avr/io</em>, or <em>util/delay</em> and write simple programs like "arduino hello world".</p>

<p>My problem comes with more complex tasks such as acting as usb mouse. On <a href="http://pjrc.com" rel="nofollow">http://pjrc.com</a> are references just to use with arduino ide/wiring. I couldn't find anything useful on google. Is there any good reference for pure C programming tennsy/arduino and/or using libraries such as "usb_mouse.h" (from pjrc.com) with pure C?</p>

<hr>

<p><strong>EDIT 1</strong></p>

<p>Let me add some details (based of @st2000 answer).. Yes, Tennsy (and Arduino) are microcontrollers, not microprocessors. Programming avr chips in pure C doesn't require so much work as programming microprocessors. This is the simplest avr C program I could come with (typical blinky):</p>

<pre><code>#include &lt;avr/io.h&gt;
#include &lt;util/delay.h&gt;

int main(void) {
        (CLKPR = 0x80, CLKPR = 0x00);
        DDRD |= (1&lt;&lt;6);
        PORTD &amp;= ~(1&lt;&lt;6);

        int sviti = 0;

        while (1) {
                if (sviti)
                        PORTD |= (1&lt;&lt;6);
                else
                        PORTD &amp;= ~(1&lt;&lt;6);
                sviti ^= 1;
                _delay_ms(40000);
        }
}
</code></pre>

<p>As you can see (@st2000), there are no dozens of setting up registers. It does not require any expensive equipment to upload resultant .HEX file - for teensy the only thing you need is a USB cable.</p>

<p>If you want a concrete example, I want to use <a href="http://www.pjrc.com/teensy/usb_mouse.html" rel="nofollow">this library</a> with pure C, but it's obviously meant for wiring and arduino IDE primary. So how to use this library with pure C? And back to my main question, how to generally use libraries of this kind with pure C avr programming?</p>
 20245: <p>Refer to the actual processors used on the platforms to find reference material for ordinary C or C++ programming.  There are different processors used on various Arduino boards.  Be aware that this approach normally requires programming hardware which range from a few dollars to hundreds of dollars.  Also be aware that "<a href="https://en.wikipedia.org/wiki/Bare_machine" rel="nofollow">bare metal programming</a>" requires the programmer to setup the processor's resources of interest.  This normally involves setting dozens (as in the Arduino Uno AVR processors) if not thousands (as in Arduino Zero's ARM processors) of registers which can deal with everything from the processor's clock to interrupt vectors.</p>

<p>USB programming is very complex.  Consider the complete description of RS232 could be contained in a white paper.  The equivalent for USB would be at least a book.  To simplify your efforts, we can eliminate all USB Host features as a mouse is a peripheral or USB Device.  Further, you will probably want to limit your USB Device to a USB HID or Human Interface Device.  This allows most OSs to easily recognize and use the mouse as the HID definition is more complete / restrictive. Also note, embedded processors which happen to have a USB port usually only support USB Devices as USB Host requires additional features &amp; resources.  Now that the scope of USB support has been narrowed, you can start searching through the different processor's libraries for what you need to create a USB HID Mouse.</p>
 30005: <blockquote>
  <p>And back to my main question, how to generally use libraries of this kind with pure C avr programming?</p>
</blockquote>

<p>just as how you would write under arduino ide -> arduino ide is nothing but pure c/c++ plus a set of canned libraries. so what you are trying to do is no different from what you are doing with arduino right now, maybe with your own libraries or libraries from folks other than the arduino folks.</p>

<p>nothing magic about going in "pure c".</p>
