Depends.
You can write X apps using Xlib and Xt. That's pretty basic no frills but you will need to design and write your own widgits.
Xaw was the first toolkit that provided widgets and an "API". Later on vendors produced Motif which would be used instead of Xaw. Motif, Xaw and others like it used the same philosophy wrt resources.
Then came Qt and gtk. Both of which altered the management of resources and altered the API, significantly. While in the mean time many others produced their own tookits.
Typically you would pick a tookit, i.e. gtk or Qt, and use it with the underlying Xlib.
Regarding Xcb, it's the underlying protocol. X was designed to work across the network. Your Xserver, running on your desktop machine, would display for X clients running either remotely or locally. Back in the day when UNIX workstations were prohibitively expensive one would purchase a large machine, like Sun 2000, and a bunch of smaller Sun workstations. You'd do editing on your workstation, because Sun 2000 would NFS server your $HOME (via NFS and the automounter). One would actually run the compile jobs and run apps on the larger machine.
Today this is not really needed as PCs and laptops are so powerful. Though, I tend to still use this model because I've managed to wear out a laptop CPU fan by working it too hard over the years. While my server systems downstairs can take much more work than the laptop.
That's the idea. Like Scott McNealy (CEO of Sun at the time) said, the network is the computer.
Wayland removes the network capability from its protocol speeding up apps like games. This is why the better computer games were on M$ Windows and not on X workstations. Direct access to graphic card memory. The GPU takes it one step further.