By C++ standard main() should return int. This is an error code application returns on its termination and in practice this is useful when calling process wants to know whether this application terminated with success (usually error code is 0 in this case) or it failed.
I'll give a Microsoft specific example, but it shows general need for returning error code:
ProcessA needs to create ProcessB and wait for it to terminate, after which it wants to check whether ProcessB executed successfully. ProcessA will use CreateProcess function to create ProcessB, then will use ProcessB's handle to wait for its termination and then will use GetExitCodeProcess function to get ProcessB termination code - which is int value returned from main().