Hewlett-Packard’s earnings and sales slipped last quarter as the company struggled to meet Wall Street’s expectations.