Please refer to the HMMER documentation for a complete explanation of how bit score and E-values are calculated. The following is excerpted directly from the HMMER 2.3.2 User's Guide:

Executive summary