Technically speaking, X.25 only describes what goes on at the edges -- the DCE/DTE interface, as you guessed. Within the packet switched network itself, any suitable protocol can be implemented. Of course, it has to be able to deliver the signaling and data that are implied by X.25; for example you need to be able to convey a "call request" from source to destination. And data packet boundaries need to be preserved end-to-end (it's a sequenced-packet protocol, not a byte stream protocol).
The mid-to-late 1970s picture looked like this. If you wanted your computer to talk to other computers over a packet-switcched network, then "your computer" would implement the DTE role of X.25.
Some device on Post Office property would implement the DCE role.
In my case, the two would then be connected via a Post Office leased line.
PDP-11 = DTE
|
Synchronous modem
|
Post Office leased line
|
Synchronous modem
|
DCE somewhere in Post Office property
|
+-----------------------------+
| The packet-switched network |
| (the original cloud!) |
+-----------------------------+
|
remote DCE
|
… details omitted …
|
remote DTE
In this picture, the PDP-11 is equipped with a synchronous line interface, capable of operating in bitstuff mode (e.g., a DUP-11). The modems do what modems traditionally do: condition a digital bit stream for transmission over analog communication wires. There's no X.25 intelligence in them.
(The DTE end had an actual modem as a separate box, with a cable to the line device in the PDP-11; I was not privy to what went on at the DCE end, so that end is a little figurative).
Note that the X.25 packet protocol is a network (layer 3) protocol; to the extent you can map TCP/IP to OSI layers, IP is layer 3, TCP is layer 4. X.25 provides "virtual circuits" that are analogous to real physical circuits.
The X.25 software in "your computer" would probably (certainly in my case) provide some locally-appropriate way for other programs to access X.25 virtual circuits.
A use-case would be DECnet. DECnet networks were (pre-Ethernet) built with point-to-point links, for a fully or partially connected mesh. Any such link could be replaced by an X.25 virtual circuit. Thus DECnet would be the "user" of X.25, and other programs would use DECnet, without knowing that data were travelling over X.25.