I have found one way.
Click the Subcircuit Mode icon here:
Then click on the screen, drag and create a box you want your device to look like. In the list you now have highlighted "DEFAULT". You choose "INPUT", click on your box, where you want ports to be. Than do the same with "OUTPUT". Give name to all ports by double clicking or using context menu and properties. You should get something like this:
Then click on the box and choose "Goto Child Sheet". There you can create the circuit. There you need to use INPUT and OUTPUT from the Terminals Mode (the icon right under the Subcircuit Mode icon in the first picture) and name them exactly the same as ports in the previous file. Be careful. Do not put ports on the wire. You have to connect them by the wire as any other device.
You can continue with building circuit in the parent sheet. I didn't find a way how to get it in to library to use it in other projects, but you can always copy it (Parent and Child sheet. If you copy only the box of circuit, the Child sheet will be empty).
I hope this is clear enough. My English is poor.