You can build a hierarchy with the optional Parent Company:

Create the main company first, let's call it Parent Company.
Add contacts and assign them roles: Employee or Manager.
Then create child companies (departments) and in Parent Company field enter your main company.
Again: add contacts and assign them roles: Employee or Manager for each of child companies.
You will have a hierarchy - a tree like structure.
Then you can adjust permissions in Record Browser and specify who can see what - for example Manager of the Parent Company can see everything, but employees of child companies are limited to their own records, etc. I don't know what exactly you want to accomplish, what restrictions you want to create, but this is the basic idea.
When user uses the system the selection in Employee box (for example in Tasks, Calendar etc.) will show only members of his/her company (department) but not others.