Atmel AVR Microcontrollers are commonly sold as Arduino.
Some chips (not ATMega 328P but ATMega 32U4) have native support for USB. This allows them to be used as USB HID devices: a keyboard and mouse.
Here is someone else's tutorial:
https://codeandlife.com/2012/02/11/v-usb-tutorial-continued-...
And a shameless plug for an app that I wrote that uses an Arduino to turn your laptop into a keyboard & mouse, so you don't have to carry around an external keyboard for your Raspberry Pi.
https://hackaday.com/2015/06/27/keymouserial-solves-your-ras...
In practice I now use CNLohr's EspUSB because it's even smaller. I dug out the old KeyMouSerial code last week to turn a mouse scrollwheel and iPod clickwheel into a rotary encoder.
https://www.youtube.com/watch?v=FPBzOaLbWhM
V-USB can do much more besides: actuators (power switch, DMX), sensors (thermo, hygro), chip programmers, LCD displays... there are 170 projects listed on the Obdev page.