Yes, Costco will verify your identity with a photo ID. If you don't have a valid ID, you'll be required to show proof of your membership and/or sign an affidavit. If you're under 18, Costco will require you to show proof of your parents' or guardian's membership as well.
If you forget to bring your membership card, you can use your ID card as the replacement. Reversely, you can also use your Costco membership card as identification form at the store's cash registers.