Like every other country. You exchange good or services for currencies from the other countries, and then you can use that currency to buy things from anybody that would take that currency.
There is nothing saying a socialist country can't produce goods and services, and sell them.