There are several different parts to the project.
Reading pushbuttons on the R-Pi is doable. In some ways it is easier on an Arduino,
(That sketch isn't how one would do it electrically, but that is straightforward to fix)
The problem is the emulators for the older games consoles. I have some experience supporting a team of students who wanted to run a games emulator on a R-Pi.
Each emulator will have some assumptions built-in about its games controllers. Some of the popular games console emulators already have controller emulators, which complete the hardware.
In some cases the games console emulator is straightforward to complete by building some hardware that emulates the specific games controller used by that console.
AFAICT you need to identify each game console. Then you either buy the controller hardware, or build the games controller to satisfy the console emulator, or you need to hack on the emulator source code.
IIRC the games controller the students needed to make was straightforward. Information about the controller was available on the web. The electronic interface between the RPi console emulator and the controller wasn't very complex. They built it with an Arduino, and it worked well enough for them to be satisfied.
Overview:
Exactly what you need to build for the controller mostly depends on the games console emulator you want to use. Until you decide on that, there is very little value in focusing on connecting buttons. The problem is to make a games controller which has the right electrical behaviour to work with the emulator.
You need to choose the games console emulator (or emulators) first. Then research the controllers. There is little benefit working on the pushbuttons before that; pushbuttons are relatively easy to wire up. The much harder part is building an interface between the games console emulator and the controller because you don't have free choice on how that works; the games emulator is already made to work in specific ways.
Summary: A few controllers might be built using an ATmega328, because it implements enough of the hardware interface. However, for other controllers it is the wrong place to start.
Recommendation: Pick the games console emulator with the games you most want to play, and research how it talks to its specific games controllers. Ideally find some instructions on how to build a working games controller for that emulator. Learn how it works by follow the instructions and build it. If it is far away from your goal, build it as quickly and cheaply as you can, and treat this as a learning project.
Once you have got something working, you will understand much more about the possibilities and constraints. So you will be better equipped to do what you want to do.
Aside from the practical solutions above, there is more diy hacky ways. Take apart a usb keyboard and remove the key matrix. Replace a specific matrix combination with a single push button (say an unused one like f8). Then use a software hot key program to carry out the rest based on that specific keyboard and key press.
The other way would be taking a mouse apart and doing the same. But a keyboard is simpler and with any recent cheapo one, the pcb would be about the size of a flash drive.
But a microcontroller solution can be done completely without any computer side software needed. Pure USB HID keyboard goodness.
Best Answer
You are missing the fact that USB is bidirectional serial protocol, and having two USB hosts talking to a single USB device is not supported neither on physical neither on logical level of the protocol. What you can do is to make each key of the keyboard connected to two MCUs each capable of beeing USB HID, and have their USB cables connected to two PCs. You can use two cheap AVR MCUs for this and use USB HID software implementation, just make two identical HIDkeys and connect each key to both. Btw, read the license carefully.