Answer: This is a complex area of tax law and I am not clear on the facts and issues in your question. For this reason I strongly recommend that you brief an international tax adviser who can give you specific advice once they are clear about the particular circumstances of your case.
In relation to the question you posed you state in the second sentence that you are ‘working in the US for a company’. This could mean either that you are an employee of a US company or that your UK company has secured work in the USA which requires you to be in that country. This raises some questions. How long will you be in the USA? What are the terms of your work or employment?
In general terms, under UK tax law, any company that is incorporated in the UK is treated as being UK resident no matter where it is managed and controlled. Double tax relief is available in respect of any foreign tax suffered on both income and gains provided there is a double taxation agreement between the UK and the other country, which there is between the UK and the USA.
The relief for tax on overseas income is limited to the UK corporation tax payable on that overseas income. Any unrelieved foreign tax is wasted and cannot be carried forward or back. There is a further consideration. If you have a significant share of the UK company, are its only employee and you provide services you may find yourself in an IR35 situation. If this is the case the tax position may make it inadvisable to pay a dividend. As I stated at the outset this is a complex issue and it is not sensible to proceed without taking detailed advice from an accountant who is familiar with the relevant issues and your particular circumstances.