The law requires an employer to withdraw an H-1B petition when the employment relationship ends. 8 CFR 214.2(h)(11). While the regulations do not provide any specific penalty for the employer's failure to notify, the Department of Labor asserts that until it notifies USCIS to withdraw the petition, the employer is liable for the H-1B worker's full time wages... potentially for years! Amtel v. Yongmahapakorn, Alien Labor Review Board, 2006.
To accomplish the withdrawal, the employer must merely send a letter to the USCIS Service Center that issued the H-1B approval notice, note that the employee was terminated, and ask that USCIS withdraw the petition. The letter must include the case number and the employer should include a copy of the H-1B approval notice.
USCIS should send a written confirmation of the withdrawal within two weeks. But the employer's obligation is merely to notify. This means that the employer must keep a copy of the letter directing USCIS to withdraw the petition and proof that USCIS received it (for example by using certified mail with return receipt, or FedEx).
Before the Amtel case, the standard required a clearly communicated termination of employment, which generally entailed notifying the employee of the termination and removing the employee from payroll. To avoid liability for "benching" under the H-1B program, in addition to notifying USCIS of the termination, it is wise to have a standard employee termination procedure followed for US workers and foreign nationals alike. Evidence suggesting that the employer placed the employee into temporary inactive work status because of lack of available work will expose the employer to liability for back wages for the entire period of "benching" plus civil and other penalties.